relay-runtime 9.0.0 → 9.1.0

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.
Files changed (111) hide show
  1. package/handlers/RelayDefaultHandlerProvider.js.flow +34 -0
  2. package/handlers/connection/ConnectionHandler.js.flow +549 -0
  3. package/handlers/connection/ConnectionInterface.js.flow +92 -0
  4. package/index.js +1 -1
  5. package/index.js.flow +314 -0
  6. package/lib/handlers/connection/ConnectionHandler.js +1 -3
  7. package/lib/index.js +1 -2
  8. package/lib/mutations/RelayDeclarativeMutationConfig.js +22 -45
  9. package/lib/mutations/RelayRecordProxy.js +1 -3
  10. package/lib/mutations/RelayRecordSourceMutator.js +1 -3
  11. package/lib/mutations/RelayRecordSourceProxy.js +1 -3
  12. package/lib/mutations/RelayRecordSourceSelectorProxy.js +1 -3
  13. package/lib/mutations/commitMutation.js +2 -0
  14. package/lib/mutations/validateMutation.js +13 -4
  15. package/lib/network/RelayObservable.js +9 -9
  16. package/lib/network/RelayQueryResponseCache.js +8 -6
  17. package/lib/query/fetchQueryInternal.js +1 -8
  18. package/lib/store/DataChecker.js +23 -51
  19. package/lib/store/RelayConcreteVariables.js +6 -2
  20. package/lib/store/RelayModernEnvironment.js +30 -12
  21. package/lib/store/RelayModernFragmentSpecResolver.js +9 -13
  22. package/lib/store/RelayModernQueryExecutor.js +73 -37
  23. package/lib/store/RelayModernRecord.js +14 -9
  24. package/lib/store/RelayModernStore.js +107 -70
  25. package/lib/store/RelayOperationTracker.js +35 -78
  26. package/lib/store/RelayOptimisticRecordSource.js +7 -5
  27. package/lib/store/RelayPublishQueue.js +1 -3
  28. package/lib/store/RelayReader.js +1 -3
  29. package/lib/store/RelayRecordSource.js +1 -3
  30. package/lib/store/RelayRecordSourceMapImpl.js +13 -18
  31. package/lib/store/RelayReferenceMarker.js +2 -6
  32. package/lib/store/RelayResponseNormalizer.js +9 -10
  33. package/lib/store/StoreInspector.js +7 -5
  34. package/lib/store/normalizeRelayPayload.js +6 -2
  35. package/lib/subscription/requestSubscription.js +4 -2
  36. package/lib/util/RelayFeatureFlags.js +1 -1
  37. package/lib/util/RelayReplaySubject.js +1 -3
  38. package/lib/util/createPayloadFor3DField.js +7 -2
  39. package/mutations/RelayDeclarativeMutationConfig.js.flow +380 -0
  40. package/mutations/RelayRecordProxy.js.flow +165 -0
  41. package/mutations/RelayRecordSourceMutator.js.flow +238 -0
  42. package/mutations/RelayRecordSourceProxy.js.flow +164 -0
  43. package/mutations/RelayRecordSourceSelectorProxy.js.flow +119 -0
  44. package/mutations/applyOptimisticMutation.js.flow +76 -0
  45. package/mutations/commitLocalUpdate.js.flow +24 -0
  46. package/mutations/commitMutation.js.flow +184 -0
  47. package/mutations/validateMutation.js.flow +211 -0
  48. package/network/ConvertToExecuteFunction.js.flow +49 -0
  49. package/network/RelayNetwork.js.flow +84 -0
  50. package/network/RelayNetworkTypes.js.flow +123 -0
  51. package/network/RelayObservable.js.flow +634 -0
  52. package/network/RelayQueryResponseCache.js.flow +111 -0
  53. package/package.json +1 -1
  54. package/query/GraphQLTag.js.flow +166 -0
  55. package/query/fetchQuery.js.flow +47 -0
  56. package/query/fetchQueryInternal.js.flow +349 -0
  57. package/relay-runtime.js +2 -2
  58. package/relay-runtime.min.js +2 -2
  59. package/store/ClientID.js.flow +43 -0
  60. package/store/DataChecker.js.flow +426 -0
  61. package/store/RelayConcreteVariables.js.flow +96 -0
  62. package/store/RelayModernEnvironment.js.flow +526 -0
  63. package/store/RelayModernFragmentSpecResolver.js.flow +426 -0
  64. package/store/RelayModernOperationDescriptor.js.flow +88 -0
  65. package/store/RelayModernQueryExecutor.js.flow +1327 -0
  66. package/store/RelayModernRecord.js.flow +403 -0
  67. package/store/RelayModernSelector.js.flow +444 -0
  68. package/store/RelayModernStore.js.flow +757 -0
  69. package/store/RelayOperationTracker.js.flow +164 -0
  70. package/store/RelayOptimisticRecordSource.js.flow +119 -0
  71. package/store/RelayPublishQueue.js.flow +401 -0
  72. package/store/RelayReader.js.flow +376 -0
  73. package/store/RelayRecordSource.js.flow +29 -0
  74. package/store/RelayRecordSourceMapImpl.js.flow +87 -0
  75. package/store/RelayRecordState.js.flow +37 -0
  76. package/store/RelayReferenceMarker.js.flow +236 -0
  77. package/store/RelayResponseNormalizer.js.flow +556 -0
  78. package/store/RelayStoreTypes.js.flow +873 -0
  79. package/store/RelayStoreUtils.js.flow +218 -0
  80. package/store/StoreInspector.js.flow +173 -0
  81. package/store/ViewerPattern.js.flow +26 -0
  82. package/store/cloneRelayHandleSourceField.js.flow +66 -0
  83. package/store/createFragmentSpecResolver.js.flow +55 -0
  84. package/store/createRelayContext.js.flow +44 -0
  85. package/store/defaultGetDataID.js.flow +27 -0
  86. package/store/hasOverlappingIDs.js.flow +34 -0
  87. package/store/isRelayModernEnvironment.js.flow +27 -0
  88. package/store/normalizeRelayPayload.js.flow +51 -0
  89. package/store/readInlineData.js.flow +75 -0
  90. package/subscription/requestSubscription.js.flow +100 -0
  91. package/util/JSResourceTypes.flow.js.flow +20 -0
  92. package/util/NormalizationNode.js.flow +191 -0
  93. package/util/ReaderNode.js.flow +208 -0
  94. package/util/RelayConcreteNode.js.flow +80 -0
  95. package/util/RelayDefaultHandleKey.js.flow +17 -0
  96. package/util/RelayError.js.flow +33 -0
  97. package/util/RelayFeatureFlags.js.flow +30 -0
  98. package/util/RelayProfiler.js.flow +284 -0
  99. package/util/RelayReplaySubject.js.flow +134 -0
  100. package/util/RelayRuntimeTypes.js.flow +70 -0
  101. package/util/createPayloadFor3DField.js.flow +43 -0
  102. package/util/deepFreeze.js.flow +36 -0
  103. package/util/generateID.js.flow +21 -0
  104. package/util/getFragmentIdentifier.js.flow +52 -0
  105. package/util/getRelayHandleKey.js.flow +41 -0
  106. package/util/getRequestIdentifier.js.flow +41 -0
  107. package/util/isPromise.js.flow +21 -0
  108. package/util/isScalarAndEqual.js.flow +26 -0
  109. package/util/recycleNodesInto.js.flow +80 -0
  110. package/util/resolveImmediate.js.flow +30 -0
  111. package/util/stableCopy.js.flow +35 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ // flowlint ambiguous-object-type:error
12
+
13
+ 'use strict';
14
+
15
+ const RelayModernRecord = require('./RelayModernRecord');
16
+ const RelayRecordSource = require('./RelayRecordSource');
17
+ const RelayResponseNormalizer = require('./RelayResponseNormalizer');
18
+
19
+ const {ROOT_TYPE} = require('./RelayStoreUtils');
20
+
21
+ import type {PayloadData, PayloadError} from '../network/RelayNetworkTypes';
22
+ import type {NormalizationOptions} from './RelayResponseNormalizer';
23
+ import type {
24
+ RelayResponsePayload,
25
+ NormalizationSelector,
26
+ } from './RelayStoreTypes';
27
+
28
+ function normalizeRelayPayload(
29
+ selector: NormalizationSelector,
30
+ payload: PayloadData,
31
+ errors: ?Array<PayloadError>,
32
+ options: NormalizationOptions,
33
+ ): RelayResponsePayload {
34
+ const source = RelayRecordSource.create();
35
+ source.set(
36
+ selector.dataID,
37
+ RelayModernRecord.create(selector.dataID, ROOT_TYPE),
38
+ );
39
+ const relayPayload = RelayResponseNormalizer.normalize(
40
+ source,
41
+ selector,
42
+ payload,
43
+ options,
44
+ );
45
+ return {
46
+ ...relayPayload,
47
+ errors,
48
+ };
49
+ }
50
+
51
+ module.exports = normalizeRelayPayload;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ // flowlint ambiguous-object-type:error
12
+
13
+ 'use strict';
14
+
15
+ const invariant = require('invariant');
16
+
17
+ const {getInlineDataFragment} = require('../query/GraphQLTag');
18
+ const {FRAGMENTS_KEY} = require('./RelayStoreUtils');
19
+
20
+ import type {GraphQLTaggedNode} from '../query/GraphQLTag';
21
+ import type {FragmentReference} from './RelayStoreTypes';
22
+
23
+ /**
24
+ * Reads an @inline data fragment that was spread into the parent fragment.
25
+ */
26
+
27
+ declare function readInlineData<
28
+ TRef: FragmentReference,
29
+ TData,
30
+ TKey: {
31
+ +$data?: TData,
32
+ +$fragmentRefs: TRef,
33
+ ...
34
+ },
35
+ >(
36
+ fragment: GraphQLTaggedNode,
37
+ fragmentRef: TKey,
38
+ ): TData;
39
+ declare function readInlineData<
40
+ TRef: FragmentReference,
41
+ TData,
42
+ TKey: ?{
43
+ +$data?: TData,
44
+ +$fragmentRefs: TRef,
45
+ ...
46
+ },
47
+ >(
48
+ fragment: GraphQLTaggedNode,
49
+ fragmentRef: null | void,
50
+ ): ?TData;
51
+ function readInlineData(
52
+ fragment: GraphQLTaggedNode,
53
+ fragmentRef: mixed,
54
+ ): mixed {
55
+ const inlineDataFragment = getInlineDataFragment(fragment);
56
+ if (fragmentRef == null) {
57
+ return fragmentRef;
58
+ }
59
+ invariant(
60
+ typeof fragmentRef === 'object',
61
+ 'readInlineData(): Expected an object, got `%s`.',
62
+ typeof fragmentRef,
63
+ );
64
+ // $FlowFixMe
65
+ const inlineData = fragmentRef[FRAGMENTS_KEY]?.[inlineDataFragment.name];
66
+ invariant(
67
+ inlineData != null,
68
+ 'readInlineData(): Expected fragment `%s` to be spread in the parent ' +
69
+ 'fragment.',
70
+ inlineDataFragment.name,
71
+ );
72
+ return inlineData;
73
+ }
74
+
75
+ module.exports = readInlineData;
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ * @format
9
+ */
10
+
11
+ // flowlint ambiguous-object-type:error
12
+
13
+ 'use strict';
14
+
15
+ const RelayDeclarativeMutationConfig = require('../mutations/RelayDeclarativeMutationConfig');
16
+
17
+ const warning = require('warning');
18
+
19
+ const {getRequest} = require('../query/GraphQLTag');
20
+ const {
21
+ createOperationDescriptor,
22
+ } = require('../store/RelayModernOperationDescriptor');
23
+
24
+ import type {DeclarativeMutationConfig} from '../mutations/RelayDeclarativeMutationConfig';
25
+ import type {GraphQLTaggedNode} from '../query/GraphQLTag';
26
+ import type {
27
+ IEnvironment,
28
+ SelectorStoreUpdater,
29
+ } from '../store/RelayStoreTypes';
30
+ import type {
31
+ CacheConfig,
32
+ Disposable,
33
+ Variables,
34
+ } from '../util/RelayRuntimeTypes';
35
+
36
+ export type GraphQLSubscriptionConfig<TSubscriptionPayload> = {|
37
+ configs?: Array<DeclarativeMutationConfig>,
38
+ cacheConfig?: CacheConfig,
39
+ subscription: GraphQLTaggedNode,
40
+ variables: Variables,
41
+ onCompleted?: ?() => void,
42
+ onError?: ?(error: Error) => void,
43
+ onNext?: ?(response: ?TSubscriptionPayload) => void,
44
+ updater?: ?SelectorStoreUpdater,
45
+ |};
46
+
47
+ function requestSubscription<TSubscriptionPayload>(
48
+ environment: IEnvironment,
49
+ config: GraphQLSubscriptionConfig<TSubscriptionPayload>,
50
+ ): Disposable {
51
+ const subscription = getRequest(config.subscription);
52
+ if (subscription.params.operationKind !== 'subscription') {
53
+ throw new Error('requestSubscription: Must use Subscription operation');
54
+ }
55
+ const {
56
+ configs,
57
+ onCompleted,
58
+ onError,
59
+ onNext,
60
+ variables,
61
+ cacheConfig,
62
+ } = config;
63
+ const operation = createOperationDescriptor(subscription, variables);
64
+
65
+ warning(
66
+ !(config.updater && configs),
67
+ 'requestSubscription: Expected only one of `updater` and `configs` to be provided',
68
+ );
69
+
70
+ const {updater} = configs
71
+ ? RelayDeclarativeMutationConfig.convert(
72
+ configs,
73
+ subscription,
74
+ null /* optimisticUpdater */,
75
+ config.updater,
76
+ )
77
+ : config;
78
+
79
+ const sub = environment
80
+ .execute({
81
+ operation,
82
+ updater,
83
+ cacheConfig,
84
+ })
85
+ .map(() => {
86
+ const data = environment.lookup(operation.fragment).data;
87
+ // $FlowFixMe
88
+ return (data: TSubscriptionPayload);
89
+ })
90
+ .subscribe({
91
+ next: onNext,
92
+ error: onError,
93
+ complete: onCompleted,
94
+ });
95
+ return {
96
+ dispose: sub.unsubscribe,
97
+ };
98
+ }
99
+
100
+ module.exports = requestSubscription;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @emails oncall+relay
8
+ * @flow strict
9
+ * @format
10
+ */
11
+
12
+ // flowlint ambiguous-object-type:error
13
+
14
+ 'use strict';
15
+
16
+ export interface JSResourceReference<+T> {
17
+ +getModuleId: () => string;
18
+ +getModuleIfRequired: () => ?T;
19
+ +load: () => Promise<T>;
20
+ }
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ // flowlint ambiguous-object-type:error
12
+
13
+ 'use strict';
14
+
15
+ /**
16
+ * Represents a single operation used to processing and normalize runtime
17
+ * request results.
18
+ */
19
+ export type NormalizationOperation = {|
20
+ +kind: 'Operation',
21
+ +name: string,
22
+ +argumentDefinitions: $ReadOnlyArray<NormalizationLocalArgumentDefinition>,
23
+ +selections: $ReadOnlyArray<NormalizationSelection>,
24
+ |};
25
+
26
+ export type NormalizationHandle =
27
+ | NormalizationScalarHandle
28
+ | NormalizationLinkedHandle;
29
+
30
+ export type NormalizationLinkedHandle = {|
31
+ +kind: 'LinkedHandle',
32
+ +alias: ?string,
33
+ +name: string,
34
+ +args: ?$ReadOnlyArray<NormalizationArgument>,
35
+ +handle: string,
36
+ +key: string,
37
+ // T45504512: new connection model
38
+ // NOTE: this property is optional because it's expected to be rarely used
39
+ +dynamicKey?: ?NormalizationArgument,
40
+ +filters: ?$ReadOnlyArray<string>,
41
+ |};
42
+
43
+ export type NormalizationScalarHandle = {|
44
+ +kind: 'ScalarHandle',
45
+ +alias: ?string,
46
+ +name: string,
47
+ +args: ?$ReadOnlyArray<NormalizationArgument>,
48
+ +handle: string,
49
+ +key: string,
50
+ // T45504512: new connection model
51
+ // NOTE: this property is optional because it's expected to be rarely used
52
+ +dynamicKey?: ?NormalizationArgument,
53
+ +filters: ?$ReadOnlyArray<string>,
54
+ |};
55
+
56
+ export type NormalizationArgument =
57
+ | NormalizationListValueArgument
58
+ | NormalizationLiteralArgument
59
+ | NormalizationObjectValueArgument
60
+ | NormalizationVariableArgument;
61
+
62
+ export type NormalizationCondition = {|
63
+ +kind: 'Condition',
64
+ +passingValue: boolean,
65
+ +condition: string,
66
+ +selections: $ReadOnlyArray<NormalizationSelection>,
67
+ |};
68
+
69
+ export type NormalizationClientExtension = {|
70
+ +kind: 'ClientExtension',
71
+ +selections: $ReadOnlyArray<NormalizationSelection>,
72
+ |};
73
+
74
+ export type NormalizationField =
75
+ | NormalizationScalarField
76
+ | NormalizationLinkedField;
77
+
78
+ export type NormalizationInlineFragment = {|
79
+ +kind: 'InlineFragment',
80
+ +selections: $ReadOnlyArray<NormalizationSelection>,
81
+ +type: string,
82
+ |};
83
+
84
+ export type NormalizationLinkedField = {|
85
+ +kind: 'LinkedField',
86
+ +alias: ?string,
87
+ +name: string,
88
+ +storageKey: ?string,
89
+ +args: ?$ReadOnlyArray<NormalizationArgument>,
90
+ +concreteType: ?string,
91
+ +plural: boolean,
92
+ +selections: $ReadOnlyArray<NormalizationSelection>,
93
+ |};
94
+
95
+ export type NormalizationModuleImport = {|
96
+ +kind: 'ModuleImport',
97
+ +documentName: string,
98
+ +fragmentPropName: string,
99
+ +fragmentName: string,
100
+ |};
101
+
102
+ export type NormalizationListValueArgument = {|
103
+ +kind: 'ListValue',
104
+ +name: string,
105
+ +items: $ReadOnlyArray<NormalizationArgument | null>,
106
+ |};
107
+
108
+ export type NormalizationLiteralArgument = {|
109
+ +kind: 'Literal',
110
+ +name: string,
111
+ +type?: ?string,
112
+ +value: mixed,
113
+ |};
114
+
115
+ export type NormalizationLocalArgumentDefinition = {|
116
+ +kind: 'LocalArgument',
117
+ +name: string,
118
+ +type: string,
119
+ +defaultValue: mixed,
120
+ |};
121
+
122
+ export type NormalizationNode =
123
+ | NormalizationClientExtension
124
+ | NormalizationCondition
125
+ | NormalizationDefer
126
+ | NormalizationInlineFragment
127
+ | NormalizationLinkedField
128
+ | NormalizationOperation
129
+ | NormalizationSplitOperation
130
+ | NormalizationStream;
131
+
132
+ export type NormalizationScalarField = {|
133
+ +kind: 'ScalarField',
134
+ +alias: ?string,
135
+ +name: string,
136
+ +args: ?$ReadOnlyArray<NormalizationArgument>,
137
+ +storageKey: ?string,
138
+ |};
139
+
140
+ export type NormalizationSelection =
141
+ | NormalizationCondition
142
+ | NormalizationClientExtension
143
+ | NormalizationDefer
144
+ | NormalizationField
145
+ | NormalizationHandle
146
+ | NormalizationInlineFragment
147
+ | NormalizationModuleImport
148
+ | NormalizationStream;
149
+
150
+ export type NormalizationSplitOperation = {|
151
+ +kind: 'SplitOperation',
152
+ +name: string,
153
+ +metadata: ?{+[key: string]: mixed, ...},
154
+ +selections: $ReadOnlyArray<NormalizationSelection>,
155
+ |};
156
+
157
+ export type NormalizationStream = {|
158
+ +if: string | null,
159
+ +kind: 'Stream',
160
+ +label: string,
161
+ +useCustomizedBatch: string | null,
162
+ +metadata: ?{+[key: string]: mixed, ...},
163
+ +selections: $ReadOnlyArray<NormalizationSelection>,
164
+ |};
165
+
166
+ export type NormalizationDefer = {|
167
+ +if: string | null,
168
+ +kind: 'Defer',
169
+ +label: string,
170
+ +selections: $ReadOnlyArray<NormalizationSelection>,
171
+ |};
172
+
173
+ export type NormalizationVariableArgument = {|
174
+ +kind: 'Variable',
175
+ +name: string,
176
+ +type?: ?string,
177
+ +variableName: string,
178
+ |};
179
+
180
+ export type NormalizationObjectValueArgument = {|
181
+ +kind: 'ObjectValue',
182
+ +name: string,
183
+ +fields: $ReadOnlyArray<NormalizationArgument>,
184
+ |};
185
+
186
+ export type NormalizationSelectableNode =
187
+ | NormalizationDefer
188
+ | NormalizationLinkedField
189
+ | NormalizationOperation
190
+ | NormalizationSplitOperation
191
+ | NormalizationStream;
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ // flowlint ambiguous-object-type:error
12
+
13
+ 'use strict';
14
+
15
+ import type {ConnectionMetadata} from '../handlers/connection/ConnectionHandler';
16
+ import type {ConcreteRequest} from './RelayConcreteNode';
17
+
18
+ export type ReaderFragmentSpread = {|
19
+ +kind: 'FragmentSpread',
20
+ +name: string,
21
+ +args: ?$ReadOnlyArray<ReaderArgument>,
22
+ |};
23
+
24
+ export type ReaderInlineDataFragmentSpread = {|
25
+ +kind: 'InlineDataFragmentSpread',
26
+ +name: string,
27
+ +selections: $ReadOnlyArray<ReaderSelection>,
28
+ |};
29
+
30
+ export type ReaderFragment = {|
31
+ +kind: 'Fragment',
32
+ +name: string,
33
+ +type: string,
34
+ +metadata: ?{|
35
+ +connection?: $ReadOnlyArray<ConnectionMetadata>,
36
+ +mask?: boolean,
37
+ +plural?: boolean,
38
+ +refetch?: ReaderRefetchMetadata,
39
+ |},
40
+ +argumentDefinitions: $ReadOnlyArray<ReaderArgumentDefinition>,
41
+ +selections: $ReadOnlyArray<ReaderSelection>,
42
+ |};
43
+
44
+ // Marker type for a @refetchable fragment
45
+ export type ReaderRefetchableFragment = {|
46
+ ...ReaderFragment,
47
+ +metadata: {|
48
+ +connection?: [ConnectionMetadata],
49
+ +refetch: ReaderRefetchMetadata,
50
+ |},
51
+ |};
52
+
53
+ // Marker Type for a @refetchable fragment with a single use of @connection
54
+ export type ReaderPaginationFragment = {|
55
+ ...ReaderFragment,
56
+ +metadata: {|
57
+ +connection: [ConnectionMetadata],
58
+ +refetch: {|
59
+ ...ReaderRefetchMetadata,
60
+ connection: ReaderPaginationMetadata,
61
+ |},
62
+ |},
63
+ |};
64
+
65
+ export type ReaderRefetchMetadata = {|
66
+ +connection: ?ReaderPaginationMetadata,
67
+ +operation: string | ConcreteRequest,
68
+ +fragmentPathInResult: Array<string>,
69
+ +identifierField?: ?string,
70
+ |};
71
+
72
+ // Stricter form of ConnectionMetadata
73
+ export type ReaderPaginationMetadata = {|
74
+ +backward: {|
75
+ +count: string,
76
+ +cursor: string,
77
+ |} | null,
78
+ +forward: {|
79
+ +count: string,
80
+ +cursor: string,
81
+ |} | null,
82
+ +path: $ReadOnlyArray<string>,
83
+ |};
84
+
85
+ export type ReaderInlineDataFragment = {|
86
+ +kind: 'InlineDataFragment',
87
+ +name: string,
88
+ |};
89
+
90
+ export type ReaderArgument =
91
+ | ReaderListValueArgument
92
+ | ReaderLiteralArgument
93
+ | ReaderObjectValueArgument
94
+ | ReaderVariableArgument;
95
+
96
+ export type ReaderArgumentDefinition = ReaderLocalArgument | ReaderRootArgument;
97
+
98
+ export type ReaderCondition = {|
99
+ +kind: 'Condition',
100
+ +passingValue: boolean,
101
+ +condition: string,
102
+ +selections: $ReadOnlyArray<ReaderSelection>,
103
+ |};
104
+
105
+ export type ReaderClientExtension = {|
106
+ +kind: 'ClientExtension',
107
+ +selections: $ReadOnlyArray<ReaderSelection>,
108
+ |};
109
+
110
+ export type ReaderField = ReaderScalarField | ReaderLinkedField;
111
+
112
+ export type ReaderRootArgument = {|
113
+ +kind: 'RootArgument',
114
+ +name: string,
115
+ +type: ?string,
116
+ |};
117
+
118
+ export type ReaderInlineFragment = {|
119
+ +kind: 'InlineFragment',
120
+ +selections: $ReadOnlyArray<ReaderSelection>,
121
+ +type: string,
122
+ |};
123
+
124
+ export type ReaderLinkedField = {|
125
+ +kind: 'LinkedField',
126
+ +alias: ?string,
127
+ +name: string,
128
+ +storageKey: ?string,
129
+ +args: ?$ReadOnlyArray<ReaderArgument>,
130
+ +concreteType: ?string,
131
+ +plural: boolean,
132
+ +selections: $ReadOnlyArray<ReaderSelection>,
133
+ |};
134
+
135
+ export type ReaderModuleImport = {|
136
+ +kind: 'ModuleImport',
137
+ +documentName: string,
138
+ +fragmentPropName: string,
139
+ +fragmentName: string,
140
+ |};
141
+
142
+ export type ReaderListValueArgument = {|
143
+ +kind: 'ListValue',
144
+ +name: string,
145
+ +items: $ReadOnlyArray<ReaderArgument | null>,
146
+ |};
147
+
148
+ export type ReaderLiteralArgument = {|
149
+ +kind: 'Literal',
150
+ +name: string,
151
+ +type?: ?string,
152
+ +value: mixed,
153
+ |};
154
+
155
+ export type ReaderLocalArgument = {|
156
+ +kind: 'LocalArgument',
157
+ +name: string,
158
+ +type: string,
159
+ +defaultValue: mixed,
160
+ |};
161
+
162
+ export type ReaderObjectValueArgument = {|
163
+ +kind: 'ObjectValue',
164
+ +name: string,
165
+ +fields: $ReadOnlyArray<ReaderArgument>,
166
+ |};
167
+
168
+ export type ReaderNode =
169
+ | ReaderCondition
170
+ | ReaderLinkedField
171
+ | ReaderFragment
172
+ | ReaderInlineFragment;
173
+
174
+ export type ReaderScalarField = {|
175
+ +kind: 'ScalarField',
176
+ +alias: ?string,
177
+ +name: string,
178
+ +args: ?$ReadOnlyArray<ReaderArgument>,
179
+ +storageKey: ?string,
180
+ |};
181
+
182
+ export type ReaderDefer = {|
183
+ +kind: 'Defer',
184
+ +selections: $ReadOnlyArray<ReaderSelection>,
185
+ |};
186
+
187
+ export type ReaderStream = {|
188
+ +kind: 'Stream',
189
+ +selections: $ReadOnlyArray<ReaderSelection>,
190
+ |};
191
+
192
+ export type ReaderSelection =
193
+ | ReaderCondition
194
+ | ReaderClientExtension
195
+ | ReaderDefer
196
+ | ReaderField
197
+ | ReaderFragmentSpread
198
+ | ReaderInlineDataFragmentSpread
199
+ | ReaderInlineFragment
200
+ | ReaderModuleImport
201
+ | ReaderStream;
202
+
203
+ export type ReaderVariableArgument = {|
204
+ +kind: 'Variable',
205
+ +name: string,
206
+ +type?: ?string,
207
+ +variableName: string,
208
+ |};