Skip to content

Commit

Permalink
Create operation description with correct cache config in usePreloade…
Browse files Browse the repository at this point in the history
…dQuery

Reviewed By: jstejada

Differential Revision: D27341631

fbshipit-source-id: cc81bf190b7b1de473f8d27c036c4fdfc61b56b4
  • Loading branch information
rubennorte authored and facebook-github-bot committed Apr 6, 2021
1 parent 9e7578c commit e0713aa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/react-relay/relay-hooks/usePreloadedQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,18 @@ function usePreloadedQuery<TQuery: OperationType>(
useTrackLoadQueryInRender();
const environment = useRelayEnvironment();
const {fetchKey, fetchPolicy, source, variables} = preloadedQuery;
const operation = useMemoOperationDescriptor(gqlQuery, variables);
const {
fetchKey,
fetchPolicy,
source,
variables,
networkCacheConfig,
} = preloadedQuery;
const operation = useMemoOperationDescriptor(
gqlQuery,
variables,
networkCacheConfig,
);
let useLazyLoadQueryNodeParams;
if (preloadedQuery.kind === 'PreloadedQuery_DEPRECATED') {
Expand Down

0 comments on commit e0713aa

Please sign in to comment.