react-relay 20.0.0 → 20.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v20.0.0
2
+ * Relay v20.1.1
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -29,7 +29,7 @@ const {
29
29
  isScalarAndEqual,
30
30
  } = require('relay-runtime');
31
31
 
32
- type ContainerProps = $FlowFixMeProps;
32
+ type ContainerProps = $FlowFixMe;
33
33
  type ContainerState = {
34
34
  data: {[key: string]: mixed, ...},
35
35
  prevProps: ContainerProps,
@@ -347,7 +347,7 @@ function createContainerWithFragments<
347
347
  connectionConfig.getFragmentVariables ||
348
348
  createGetFragmentVariables(metadata);
349
349
 
350
- return class extends React.Component<$FlowFixMeProps, ContainerState> {
350
+ return class extends React.Component<$FlowFixMe, ContainerState> {
351
351
  // $FlowFixMe[missing-local-annot]
352
352
  static displayName = containerName;
353
353
 
@@ -805,7 +805,7 @@ function createContainerWithFragments<
805
805
  ...fragmentVariables,
806
806
  }: Variables);
807
807
 
808
- const cacheConfig: ?CacheConfig = options
808
+ const cacheConfig: ?{...CacheConfig} = options
809
809
  ? {force: !!options.force}
810
810
  : undefined;
811
811
  if (cacheConfig != null && options?.metadata != null) {
@@ -49,7 +49,7 @@ const {
49
49
  } = require('relay-runtime');
50
50
  const warning = require('warning');
51
51
 
52
- type ContainerProps = $FlowFixMeProps;
52
+ type ContainerProps = $FlowFixMe;
53
53
 
54
54
  type ContainerState = {
55
55
  data: {[key: string]: mixed, ...},
@@ -339,7 +339,7 @@ function createContainerWithFragments<
339
339
  ? {...fetchVariables, ...renderVariables}
340
340
  : fetchVariables;
341
341
 
342
- const cacheConfig: ?CacheConfig = options
342
+ const cacheConfig: ?{...CacheConfig} = options
343
343
  ? {force: !!options.force}
344
344
  : undefined;
345
345
  if (cacheConfig != null && options?.metadata != null) {
@@ -30,8 +30,10 @@ function getRootVariablesForFragments<TProps: {...}>(
30
30
  const selector = getSelector(fragmentNode, fragmentRef);
31
31
  const fragmentOwnerVariables =
32
32
  selector != null && selector.kind === 'PluralReaderSelector'
33
- ? selector.selectors[0]?.owner.variables ?? {}
34
- : selector?.owner.variables ?? {};
33
+ ? (selector.selectors[0]?.owner.variables ?? {})
34
+ : (selector?.owner.variables ?? {});
35
+ /* $FlowFixMe[incompatible-indexer] Natural Inference rollout. See
36
+ * https://fburl.com/gdoc/y8dn025u */
35
37
  rootVariables = {
36
38
  ...rootVariables,
37
39
  ...fragmentOwnerVariables,
package/hooks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v20.0.0
2
+ * Relay v20.1.1
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v20.0.0
2
+ * Relay v20.1.1
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/legacy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v20.0.0
2
+ * Relay v20.1.1
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -193,7 +193,7 @@ var FragmentResourceImpl = /*#__PURE__*/function () {
193
193
  }
194
194
  }
195
195
  var fragmentSelector = getSelector(fragmentNode, fragmentRef);
196
- !(fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'In this case, pass `null` if the conditions for evaluating the ' + 'fragment are not met (e.g. if the `@include(if)` value is false.)', fragmentNode.name, fragmentNode.name, componentDisplayName, fragmentNode.name, fragmentKey == null ? 'a fragment reference' : "the `".concat(fragmentKey, "`"), componentDisplayName) : invariant(false) : void 0;
196
+ !(fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'This issue can generally be fixed by adding `@alias` after `...%s`.\n' + 'See https://relay.dev/docs/next/guides/alias-directive/', fragmentNode.name, fragmentNode.name, componentDisplayName, fragmentNode.name, fragmentKey == null ? 'a fragment reference' : "the `".concat(fragmentKey, "`"), componentDisplayName, fragmentNode.name) : invariant(false) : void 0;
197
197
  var fragmentResult = null;
198
198
  var snapshot = null;
199
199
  if (RelayFeatureFlags.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE && cachedValue != null && cachedValue.kind === 'missing') {
@@ -127,7 +127,7 @@ function readFragmentInternal(environment, fragmentNode, fragmentRef, hookDispla
127
127
  } else {
128
128
  !!Array.isArray(fragmentRef) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected fragment pointer%s for fragment `%s` not to be ' + 'an array, instead got `%s`. Add `@relay(plural: true)` ' + 'to fragment `%s` to allow the prop to be an array.', fragmentKey != null ? " for key `".concat(fragmentKey, "`") : '', fragmentNode.name, typeof fragmentRef, fragmentNode.name) : invariant(false) : void 0;
129
129
  }
130
- !(fragmentRef == null || isPlural && Array.isArray(fragmentRef) && fragmentRef.length === 0 || fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'In this case, pass `null` if the conditions for evaluating the ' + 'fragment are not met (e.g. if the `@include(if)` value is false.)', fragmentNode.name, fragmentNode.name, hookDisplayName, fragmentNode.name, fragmentKey == null ? 'a fragment reference' : "the `".concat(fragmentKey, "`"), hookDisplayName) : invariant(false) : void 0;
130
+ !(fragmentRef == null || isPlural && Array.isArray(fragmentRef) && fragmentRef.length === 0 || fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'This issue can generally be fixed by adding `@alias` after `...%s`.\n' + 'See https://relay.dev/docs/next/guides/alias-directive/', fragmentNode.name, fragmentNode.name, hookDisplayName, fragmentNode.name, fragmentKey == null ? 'a fragment reference' : "the `".concat(fragmentKey, "`"), hookDisplayName, fragmentNode.name) : invariant(false) : void 0;
131
131
  var state = getFragmentState(environment, fragmentSelector);
132
132
  var clientEdgeQueries = null;
133
133
  if (((_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.hasClientEdges) === true || RelayFeatureFlags.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES) {
@@ -308,7 +308,7 @@ function useFragmentInternal(fragmentNode, fragmentRef, hookDisplayName, queryOp
308
308
  } else {
309
309
  !!Array.isArray(fragmentRef) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected fragment pointer%s for fragment `%s` not to be ' + 'an array, instead got `%s`. Add `@relay(plural: true)` ' + 'to fragment `%s` to allow the prop to be an array.', fragmentNode.name, typeof fragmentRef, fragmentNode.name) : invariant(false) : void 0;
310
310
  }
311
- !(fragmentRef == null || isPlural && Array.isArray(fragmentRef) && fragmentRef.length === 0 || fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'In this case, pass `null` if the conditions for evaluating the ' + 'fragment are not met (e.g. if the `@include(if)` value is false.)', fragmentNode.name, fragmentNode.name, hookDisplayName, fragmentNode.name, hookDisplayName) : invariant(false) : void 0;
311
+ !(fragmentRef == null || isPlural && Array.isArray(fragmentRef) && fragmentRef.length === 0 || fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'This issue can generally be fixed by adding `@alias` after `...%s`.\n' + 'See https://relay.dev/docs/next/guides/alias-directive/', fragmentNode.name, fragmentNode.name, hookDisplayName, fragmentNode.name, hookDisplayName, fragmentNode.name) : invariant(false) : void 0;
312
312
  var environment = useRelayEnvironment();
313
313
  var loggerContext;
314
314
  if (RelayFeatureFlags.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER) {
@@ -327,7 +327,7 @@ function useFragmentInternal_EXPERIMENTAL(fragmentNode, fragmentRef, hookDisplay
327
327
  } else {
328
328
  !!Array.isArray(fragmentRef) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected fragment pointer%s for fragment `%s` not to be ' + 'an array, instead got `%s`. Add `@relay(plural: true)` ' + 'to fragment `%s` to allow the prop to be an array.', fragmentNode.name, typeof fragmentRef, fragmentNode.name) : invariant(false) : void 0;
329
329
  }
330
- !(fragmentRef == null || isPlural && Array.isArray(fragmentRef) && fragmentRef.length === 0 || fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'In this case, pass `null` if the conditions for evaluating the ' + 'fragment are not met (e.g. if the `@include(if)` value is false.)', fragmentNode.name, fragmentNode.name, hookDisplayName, fragmentNode.name, hookDisplayName) : invariant(false) : void 0;
330
+ !(fragmentRef == null || isPlural && Array.isArray(fragmentRef) && fragmentRef.length === 0 || fragmentSelector != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: Expected to receive an object where `...%s` was spread, ' + 'but the fragment reference was not found`. This is most ' + 'likely the result of:\n' + "- Forgetting to spread `%s` in `%s`'s parent's fragment.\n" + '- Conditionally fetching `%s` but unconditionally passing %s prop ' + 'to `%s`. If the parent fragment only fetches the fragment conditionally ' + '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' + 'spread - then the fragment reference will not exist. ' + 'This issue can generally be fixed by adding `@alias` after `...%s`.\n' + 'See https://relay.dev/docs/next/guides/alias-directive/', fragmentNode.name, fragmentNode.name, hookDisplayName, fragmentNode.name, hookDisplayName) : invariant(false) : void 0;
331
331
  var environment = useRelayEnvironment();
332
332
  var loggerContext;
333
333
  if (RelayFeatureFlags.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-relay",
3
3
  "description": "A framework for building GraphQL-driven React applications.",
4
- "version": "20.0.0",
4
+ "version": "20.1.1",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay",
@@ -20,7 +20,7 @@
20
20
  "fbjs": "^3.0.2",
21
21
  "invariant": "^2.2.4",
22
22
  "nullthrows": "^1.1.1",
23
- "relay-runtime": "20.0.0"
23
+ "relay-runtime": "20.1.1"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^16.9.0 || ^17 || ^18 || ^19"
@@ -293,6 +293,6 @@ export type EntryPoint<TEntryPointParams, +TEntryPointComponent> =
293
293
 
294
294
  export type PreloadParamsOf<T> = Parameters<T['getPreloadProps']>[0];
295
295
 
296
- export type IEnvironmentProvider<TOptions> = {
296
+ export type IEnvironmentProvider<TOptions> = $ReadOnly<{
297
297
  getEnvironment: (options: ?TOptions) => IEnvironment,
298
- };
298
+ }>;
@@ -22,15 +22,17 @@ const React = require('react');
22
22
 
23
23
  const {useMemo} = React;
24
24
 
25
- type Props = $ReadOnly<{
26
- children: React.Node,
25
+ type Props<TChildren> = $ReadOnly<{
26
+ children: TChildren,
27
27
  environment: IEnvironment,
28
28
  getEnvironmentForActor?: ?(
29
29
  actorIdentifier: ActorIdentifier,
30
30
  ) => IActorEnvironment,
31
31
  }>;
32
32
 
33
- function RelayEnvironmentProvider(props: Props): React.Node {
33
+ component RelayEnvironmentProvider<TChildren: React.Node>(
34
+ ...props: Props<TChildren>
35
+ ) renders TChildren {
34
36
  const {children, environment, getEnvironmentForActor} = props;
35
37
  const context = useMemo(
36
38
  () => ({environment, getEnvironmentForActor}),
@@ -73,8 +73,8 @@ function getConnectionState(
73
73
 
74
74
  const cursor =
75
75
  direction === 'forward'
76
- ? pageInfo[END_CURSOR] ?? null
77
- : pageInfo[START_CURSOR] ?? null;
76
+ ? (pageInfo[END_CURSOR] ?? null)
77
+ : (pageInfo[START_CURSOR] ?? null);
78
78
  invariant(
79
79
  cursor === null || typeof cursor === 'string',
80
80
  'Relay: Expected page info for connection in fragment `%s` to have a ' +
@@ -340,14 +340,15 @@ class FragmentResourceImpl {
340
340
  'to `%s`. If the parent fragment only fetches the fragment conditionally ' +
341
341
  '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' +
342
342
  'spread - then the fragment reference will not exist. ' +
343
- 'In this case, pass `null` if the conditions for evaluating the ' +
344
- 'fragment are not met (e.g. if the `@include(if)` value is false.)',
343
+ 'This issue can generally be fixed by adding `@alias` after `...%s`.\n' +
344
+ 'See https://relay.dev/docs/next/guides/alias-directive/',
345
345
  fragmentNode.name,
346
346
  fragmentNode.name,
347
347
  componentDisplayName,
348
348
  fragmentNode.name,
349
349
  fragmentKey == null ? 'a fragment reference' : `the \`${fragmentKey}\``,
350
350
  componentDisplayName,
351
+ fragmentNode.name,
351
352
  );
352
353
 
353
354
  let fragmentResult = null;
@@ -144,7 +144,7 @@ function loadEntryPoint<
144
144
  // that it's actually an es6 module wrapper, so unwrap it. This won't work for React classes with a static property named "default", but
145
145
  // that's probably a worthwhile trade-off.
146
146
  const component =
147
- // $FlowIgnore[prop-missing]
147
+ // $FlowFixMe[prop-missing]
148
148
  componentModule.default != null
149
149
  ? componentModule.default
150
150
  : componentModule;
@@ -351,10 +351,16 @@ function loadQuery<
351
351
  return;
352
352
  }
353
353
  if (didExecuteNetworkSource) {
354
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
355
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
354
356
  unsubscribeFromExecution && unsubscribeFromExecution();
355
357
  } else {
358
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
359
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
356
360
  unsubscribeFromNetworkRequest && unsubscribeFromNetworkRequest();
357
361
  }
362
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
363
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
358
364
  cancelOnLoadCallback && cancelOnLoadCallback();
359
365
  isNetworkRequestCancelled = true;
360
366
  };
@@ -198,14 +198,15 @@ function readFragmentInternal(
198
198
  'to `%s`. If the parent fragment only fetches the fragment conditionally ' +
199
199
  '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' +
200
200
  'spread - then the fragment reference will not exist. ' +
201
- 'In this case, pass `null` if the conditions for evaluating the ' +
202
- 'fragment are not met (e.g. if the `@include(if)` value is false.)',
201
+ 'This issue can generally be fixed by adding `@alias` after `...%s`.\n' +
202
+ 'See https://relay.dev/docs/next/guides/alias-directive/',
203
203
  fragmentNode.name,
204
204
  fragmentNode.name,
205
205
  hookDisplayName,
206
206
  fragmentNode.name,
207
207
  fragmentKey == null ? 'a fragment reference' : `the \`${fragmentKey}\``,
208
208
  hookDisplayName,
209
+ fragmentNode.name,
209
210
  );
210
211
 
211
212
  const state = getFragmentState(environment, fragmentSelector);
@@ -400,13 +400,14 @@ hook useFragmentInternal(
400
400
  'to `%s`. If the parent fragment only fetches the fragment conditionally ' +
401
401
  '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' +
402
402
  'spread - then the fragment reference will not exist. ' +
403
- 'In this case, pass `null` if the conditions for evaluating the ' +
404
- 'fragment are not met (e.g. if the `@include(if)` value is false.)',
403
+ 'This issue can generally be fixed by adding `@alias` after `...%s`.\n' +
404
+ 'See https://relay.dev/docs/next/guides/alias-directive/',
405
405
  fragmentNode.name,
406
406
  fragmentNode.name,
407
407
  hookDisplayName,
408
408
  fragmentNode.name,
409
409
  hookDisplayName,
410
+ fragmentNode.name,
410
411
  );
411
412
 
412
413
  const environment = useRelayEnvironment();
@@ -537,6 +538,7 @@ hook useFragmentInternal(
537
538
  if (
538
539
  RelayFeatureFlags.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE ||
539
540
  environment !== previousEnvironment ||
541
+ // $FlowFixMe[sketchy-null-bool]
540
542
  !committedFragmentSelectorRef.current ||
541
543
  // $FlowFixMe[react-rule-unsafe-ref]
542
544
  !areEqualSelectors(committedFragmentSelectorRef.current, fragmentSelector)
@@ -436,9 +436,9 @@ hook useFragmentInternal_EXPERIMENTAL(
436
436
  '- Conditionally fetching `%s` but unconditionally passing %s prop ' +
437
437
  'to `%s`. If the parent fragment only fetches the fragment conditionally ' +
438
438
  '- with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` ' +
439
- 'spread - then the fragment reference will not exist. ' +
440
- 'In this case, pass `null` if the conditions for evaluating the ' +
441
- 'fragment are not met (e.g. if the `@include(if)` value is false.)',
439
+ 'spread - then the fragment reference will not exist. ' +
440
+ 'This issue can generally be fixed by adding `@alias` after `...%s`.\n' +
441
+ 'See https://relay.dev/docs/next/guides/alias-directive/',
442
442
  fragmentNode.name,
443
443
  fragmentNode.name,
444
444
  hookDisplayName,
@@ -569,6 +569,7 @@ hook useFragmentInternal_EXPERIMENTAL(
569
569
  if (
570
570
  RelayFeatureFlags.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE ||
571
571
  environment !== previousEnvironment ||
572
+ // $FlowFixMe[sketchy-null-bool]
572
573
  !committedFragmentSelectorRef.current ||
573
574
  // $FlowFixMe[react-rule-unsafe-ref]
574
575
  !areEqualSelectors(committedFragmentSelectorRef.current, fragmentSelector)
@@ -93,7 +93,7 @@ hook useLazyLoadQuery<TVariables: Variables, TData>(
93
93
  /**
94
94
  * Object containing the variable values to fetch the query. These variables need to match GraphQL variables declared inside the query.
95
95
  */
96
- variables: TVariables,
96
+ variables: NoInfer<TVariables>,
97
97
  /**
98
98
  * options object
99
99
  */
@@ -16,7 +16,7 @@ import type {
16
16
  PreloadedQueryInner,
17
17
  PreloadedQueryInner_DEPRECATED,
18
18
  } from './EntryPointTypes.flow';
19
- import type {Query, RenderPolicy, Variables} from 'relay-runtime';
19
+ import type {ClientQuery, Query, RenderPolicy, Variables} from 'relay-runtime';
20
20
 
21
21
  const useLazyLoadQueryNode = require('./useLazyLoadQueryNode');
22
22
  const useMemoOperationDescriptor = require('./useMemoOperationDescriptor');
@@ -56,7 +56,9 @@ hook usePreloadedQuery<
56
56
  TData,
57
57
  TRawResponse: ?{...} = void,
58
58
  >(
59
- gqlQuery: Query<TVariables, TData, TRawResponse>,
59
+ gqlQuery:
60
+ | Query<TVariables, TData, TRawResponse>
61
+ | ClientQuery<TVariables, TData, TRawResponse>,
60
62
  preloadedQuery: PreloadedQuery<
61
63
  TVariables,
62
64
  TData,
@@ -155,6 +157,8 @@ hook usePreloadedQuery<
155
157
  variables: TVariables,
156
158
  response: TData,
157
159
  rawResponse?: $NonMaybeType<TRawResponse>,
160
+ /* $FlowFixMe[incompatible-call] Natural Inference rollout. See
161
+ * https://fburl.com/gdoc/y8dn025u */
158
162
  }>(useLazyLoadQueryNodeParams);
159
163
 
160
164
  if (__DEV__) {