Skip to content

Commit

Permalink
Log network events before store events
Browse files Browse the repository at this point in the history
Reviewed By: kassens

Differential Revision: D22504955

fbshipit-source-id: 64de1532289cd57e0fcf682af75b911a9ec5129c
  • Loading branch information
tyao1 authored and facebook-github-bot committed Jul 13, 2020
1 parent 60b6f21 commit be1c6ec
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions packages/relay-runtime/store/RelayModernEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,15 @@ class RelayModernEnvironment implements IEnvironment {
operation.request.variables,
);
return RelayObservable.create(sink => {
const source = this._network.execute(
operation.request.node.params,
operation.request.variables,
cacheConfig || {},
null,
logRequestInfo,
);
const source = this._network
.execute(
operation.request.node.params,
operation.request.variables,
cacheConfig || {},
null,
logRequestInfo,
)
.do(logObserver);
const executor = RelayModernQueryExecutor.execute({
operation,
operationExecutions: this._operationExecutions,
Expand All @@ -375,7 +377,7 @@ class RelayModernEnvironment implements IEnvironment {
treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
});
return () => executor.cancel();
}).do(logObserver);
});
}

/**
Expand Down Expand Up @@ -416,16 +418,18 @@ class RelayModernEnvironment implements IEnvironment {
updater: optimisticUpdater,
};
}
const source = this._network.execute(
operation.request.node.params,
operation.request.variables,
{
...cacheConfig,
force: true,
},
uploadables,
logRequestInfo,
);
const source = this._network
.execute(
operation.request.node.params,
operation.request.variables,
{
...cacheConfig,
force: true,
},
uploadables,
logRequestInfo,
)
.do(logObserver);
const executor = RelayModernQueryExecutor.execute({
operation,
operationExecutions: this._operationExecutions,
Expand All @@ -442,7 +446,7 @@ class RelayModernEnvironment implements IEnvironment {
treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
});
return () => executor.cancel();
}).do(logObserver);
});
}

/**
Expand Down

0 comments on commit be1c6ec

Please sign in to comment.