relay-runtime 13.0.0-rc.1 → 13.0.2

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 (216) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +64 -0
  3. package/handlers/RelayDefaultHandlerProvider.js.flow +1 -1
  4. package/handlers/connection/ConnectionHandler.js.flow +1 -1
  5. package/handlers/connection/ConnectionInterface.js.flow +1 -1
  6. package/handlers/connection/MutationHandlers.js.flow +1 -1
  7. package/index.js +2 -2
  8. package/index.js.flow +5 -1
  9. package/lib/handlers/RelayDefaultHandlerProvider.js +1 -1
  10. package/lib/handlers/connection/ConnectionHandler.js +1 -1
  11. package/lib/handlers/connection/ConnectionInterface.js +1 -1
  12. package/lib/handlers/connection/MutationHandlers.js +1 -1
  13. package/lib/index.js +8 -2
  14. package/lib/multi-actor-environment/ActorIdentifier.js +1 -1
  15. package/lib/multi-actor-environment/ActorSpecificEnvironment.js +1 -1
  16. package/lib/multi-actor-environment/ActorUtils.js +1 -1
  17. package/lib/multi-actor-environment/MultiActorEnvironment.js +1 -1
  18. package/lib/multi-actor-environment/MultiActorEnvironmentTypes.js +1 -1
  19. package/lib/multi-actor-environment/index.js +1 -1
  20. package/lib/mutations/RelayDeclarativeMutationConfig.js +1 -1
  21. package/lib/mutations/RelayRecordProxy.js +1 -1
  22. package/lib/mutations/RelayRecordSourceMutator.js +1 -1
  23. package/lib/mutations/RelayRecordSourceProxy.js +1 -1
  24. package/lib/mutations/RelayRecordSourceSelectorProxy.js +1 -1
  25. package/lib/mutations/applyOptimisticMutation.js +1 -1
  26. package/lib/mutations/commitLocalUpdate.js +1 -1
  27. package/lib/mutations/commitMutation.js +1 -1
  28. package/lib/mutations/readUpdatableQuery_EXPERIMENTAL.js +27 -18
  29. package/lib/mutations/validateMutation.js +1 -1
  30. package/lib/network/ConvertToExecuteFunction.js +1 -1
  31. package/lib/network/RelayNetwork.js +8 -4
  32. package/lib/network/RelayNetworkTypes.js +1 -1
  33. package/lib/network/RelayObservable.js +1 -1
  34. package/lib/network/RelayQueryResponseCache.js +1 -1
  35. package/lib/network/wrapNetworkWithLogObserver.js +1 -1
  36. package/lib/query/GraphQLTag.js +1 -1
  37. package/lib/query/PreloadableQueryRegistry.js +1 -1
  38. package/lib/query/fetchQuery.js +4 -1
  39. package/lib/query/fetchQueryInternal.js +1 -1
  40. package/lib/query/fetchQuery_DEPRECATED.js +1 -1
  41. package/lib/store/ClientID.js +1 -1
  42. package/lib/store/DataChecker.js +1 -1
  43. package/lib/store/OperationExecutor.js +1 -1
  44. package/lib/store/RelayConcreteVariables.js +13 -4
  45. package/lib/store/RelayExperimentalGraphResponseHandler.js +3 -3
  46. package/lib/store/RelayExperimentalGraphResponseTransform.js +54 -22
  47. package/lib/store/RelayModernEnvironment.js +1 -1
  48. package/lib/store/RelayModernFragmentSpecResolver.js +1 -1
  49. package/lib/store/RelayModernOperationDescriptor.js +2 -2
  50. package/lib/store/RelayModernRecord.js +1 -1
  51. package/lib/store/RelayModernSelector.js +1 -1
  52. package/lib/store/RelayModernStore.js +1 -1
  53. package/lib/store/RelayOperationTracker.js +1 -1
  54. package/lib/store/RelayOptimisticRecordSource.js +1 -1
  55. package/lib/store/RelayPublishQueue.js +5 -3
  56. package/lib/store/RelayReader.js +56 -16
  57. package/lib/store/RelayRecordSource.js +1 -1
  58. package/lib/store/RelayRecordState.js +1 -1
  59. package/lib/store/RelayReferenceMarker.js +1 -1
  60. package/lib/store/RelayResponseNormalizer.js +1 -1
  61. package/lib/store/RelayStoreReactFlightUtils.js +1 -1
  62. package/lib/store/RelayStoreSubscriptions.js +1 -1
  63. package/lib/store/RelayStoreTypes.js +1 -1
  64. package/lib/store/RelayStoreUtils.js +2 -1
  65. package/lib/store/ResolverCache.js +11 -3
  66. package/lib/store/ResolverFragments.js +3 -3
  67. package/lib/store/StoreInspector.js +1 -1
  68. package/lib/store/TypeID.js +1 -1
  69. package/lib/store/ViewerPattern.js +1 -1
  70. package/lib/store/cloneRelayHandleSourceField.js +1 -1
  71. package/lib/store/cloneRelayScalarHandleSourceField.js +1 -1
  72. package/lib/store/createFragmentSpecResolver.js +1 -1
  73. package/lib/store/createRelayContext.js +1 -1
  74. package/lib/store/defaultGetDataID.js +1 -1
  75. package/lib/store/defaultRequiredFieldLogger.js +1 -1
  76. package/lib/store/hasOverlappingIDs.js +1 -1
  77. package/lib/store/isRelayModernEnvironment.js +1 -1
  78. package/lib/store/normalizeRelayPayload.js +1 -1
  79. package/lib/store/readInlineData.js +1 -1
  80. package/lib/subscription/requestSubscription.js +1 -3
  81. package/lib/util/JSResourceTypes.flow.js +1 -1
  82. package/lib/util/NormalizationNode.js +1 -1
  83. package/lib/util/ReaderNode.js +1 -1
  84. package/lib/util/RelayConcreteNode.js +1 -1
  85. package/lib/util/RelayDefaultHandleKey.js +1 -1
  86. package/lib/util/RelayError.js +1 -1
  87. package/lib/util/RelayFeatureFlags.js +1 -2
  88. package/lib/util/RelayProfiler.js +1 -1
  89. package/lib/util/RelayReplaySubject.js +1 -1
  90. package/lib/util/RelayRuntimeTypes.js +1 -1
  91. package/lib/util/StringInterner.js +1 -1
  92. package/lib/util/createPayloadFor3DField.js +1 -1
  93. package/lib/util/deepFreeze.js +1 -1
  94. package/lib/util/generateID.js +1 -1
  95. package/lib/util/getFragmentIdentifier.js +1 -1
  96. package/lib/util/getOperation.js +1 -1
  97. package/lib/util/getPaginationMetadata.js +1 -1
  98. package/lib/util/getPaginationVariables.js +1 -1
  99. package/lib/util/getPendingOperationsForFragment.js +1 -1
  100. package/lib/util/getRefetchMetadata.js +1 -1
  101. package/lib/util/getRelayHandleKey.js +1 -1
  102. package/lib/util/getRequestIdentifier.js +1 -1
  103. package/lib/util/getValueAtPath.js +1 -1
  104. package/lib/util/isEmptyObject.js +1 -1
  105. package/lib/util/isPromise.js +1 -1
  106. package/lib/util/isScalarAndEqual.js +1 -1
  107. package/lib/util/recycleNodesInto.js +1 -1
  108. package/lib/util/registerEnvironmentWithDevTools.js +1 -1
  109. package/lib/util/reportMissingRequiredFields.js +1 -1
  110. package/lib/util/resolveImmediate.js +1 -1
  111. package/lib/util/stableCopy.js +1 -1
  112. package/lib/util/withDuration.js +1 -1
  113. package/lib/util/withProvidedVariables.js +49 -0
  114. package/multi-actor-environment/ActorIdentifier.js.flow +1 -1
  115. package/multi-actor-environment/ActorSpecificEnvironment.js.flow +1 -1
  116. package/multi-actor-environment/ActorUtils.js.flow +1 -1
  117. package/multi-actor-environment/MultiActorEnvironment.js.flow +1 -1
  118. package/multi-actor-environment/MultiActorEnvironmentTypes.js.flow +1 -1
  119. package/multi-actor-environment/index.js.flow +1 -1
  120. package/mutations/RelayDeclarativeMutationConfig.js.flow +1 -2
  121. package/mutations/RelayRecordProxy.js.flow +1 -1
  122. package/mutations/RelayRecordSourceMutator.js.flow +1 -1
  123. package/mutations/RelayRecordSourceProxy.js.flow +1 -1
  124. package/mutations/RelayRecordSourceSelectorProxy.js.flow +1 -1
  125. package/mutations/applyOptimisticMutation.js.flow +1 -1
  126. package/mutations/commitLocalUpdate.js.flow +1 -1
  127. package/mutations/commitMutation.js.flow +9 -20
  128. package/mutations/readUpdatableQuery_EXPERIMENTAL.js.flow +57 -50
  129. package/mutations/validateMutation.js.flow +1 -1
  130. package/network/ConvertToExecuteFunction.js.flow +1 -1
  131. package/network/RelayNetwork.js.flow +11 -4
  132. package/network/RelayNetworkTypes.js.flow +2 -2
  133. package/network/RelayObservable.js.flow +1 -1
  134. package/network/RelayQueryResponseCache.js.flow +1 -1
  135. package/network/wrapNetworkWithLogObserver.js.flow +2 -3
  136. package/package.json +2 -2
  137. package/query/GraphQLTag.js.flow +2 -2
  138. package/query/PreloadableQueryRegistry.js.flow +3 -2
  139. package/query/fetchQuery.js.flow +16 -12
  140. package/query/fetchQueryInternal.js.flow +1 -1
  141. package/query/fetchQuery_DEPRECATED.js.flow +1 -1
  142. package/relay-runtime.js +2 -2
  143. package/relay-runtime.min.js +3 -3
  144. package/store/ClientID.js.flow +1 -1
  145. package/store/DataChecker.js.flow +1 -1
  146. package/store/OperationExecutor.js.flow +1 -1
  147. package/store/RelayConcreteVariables.js.flow +13 -3
  148. package/store/RelayExperimentalGraphResponseHandler.js.flow +3 -6
  149. package/store/RelayExperimentalGraphResponseTransform.js.flow +51 -22
  150. package/store/RelayModernEnvironment.js.flow +1 -1
  151. package/store/RelayModernFragmentSpecResolver.js.flow +1 -1
  152. package/store/RelayModernOperationDescriptor.js.flow +6 -2
  153. package/store/RelayModernRecord.js.flow +1 -1
  154. package/store/RelayModernSelector.js.flow +1 -1
  155. package/store/RelayModernStore.js.flow +1 -2
  156. package/store/RelayOperationTracker.js.flow +1 -1
  157. package/store/RelayOptimisticRecordSource.js.flow +1 -1
  158. package/store/RelayPublishQueue.js.flow +9 -2
  159. package/store/RelayReader.js.flow +79 -39
  160. package/store/RelayRecordSource.js.flow +1 -1
  161. package/store/RelayRecordState.js.flow +1 -1
  162. package/store/RelayReferenceMarker.js.flow +1 -1
  163. package/store/RelayResponseNormalizer.js.flow +1 -1
  164. package/store/RelayStoreReactFlightUtils.js.flow +1 -1
  165. package/store/RelayStoreSubscriptions.js.flow +1 -1
  166. package/store/RelayStoreTypes.js.flow +4 -3
  167. package/store/RelayStoreUtils.js.flow +2 -1
  168. package/store/ResolverCache.js.flow +19 -6
  169. package/store/ResolverFragments.js.flow +3 -3
  170. package/store/StoreInspector.js.flow +1 -1
  171. package/store/TypeID.js.flow +1 -1
  172. package/store/ViewerPattern.js.flow +1 -1
  173. package/store/cloneRelayHandleSourceField.js.flow +1 -1
  174. package/store/cloneRelayScalarHandleSourceField.js.flow +1 -1
  175. package/store/createFragmentSpecResolver.js.flow +1 -1
  176. package/store/createRelayContext.js.flow +1 -1
  177. package/store/defaultGetDataID.js.flow +1 -1
  178. package/store/defaultRequiredFieldLogger.js.flow +1 -1
  179. package/store/hasOverlappingIDs.js.flow +1 -1
  180. package/store/isRelayModernEnvironment.js.flow +1 -1
  181. package/store/normalizeRelayPayload.js.flow +1 -1
  182. package/store/readInlineData.js.flow +1 -1
  183. package/subscription/requestSubscription.js.flow +8 -14
  184. package/util/JSResourceTypes.flow.js.flow +1 -1
  185. package/util/NormalizationNode.js.flow +1 -1
  186. package/util/ReaderNode.js.flow +1 -1
  187. package/util/RelayConcreteNode.js.flow +5 -3
  188. package/util/RelayDefaultHandleKey.js.flow +1 -1
  189. package/util/RelayError.js.flow +1 -1
  190. package/util/RelayFeatureFlags.js.flow +1 -3
  191. package/util/RelayProfiler.js.flow +1 -1
  192. package/util/RelayReplaySubject.js.flow +1 -1
  193. package/util/RelayRuntimeTypes.js.flow +1 -1
  194. package/util/StringInterner.js.flow +1 -1
  195. package/util/createPayloadFor3DField.js.flow +1 -1
  196. package/util/deepFreeze.js.flow +1 -1
  197. package/util/generateID.js.flow +1 -1
  198. package/util/getFragmentIdentifier.js.flow +1 -1
  199. package/util/getOperation.js.flow +1 -1
  200. package/util/getPaginationMetadata.js.flow +3 -6
  201. package/util/getPaginationVariables.js.flow +1 -1
  202. package/util/getPendingOperationsForFragment.js.flow +1 -1
  203. package/util/getRefetchMetadata.js.flow +3 -6
  204. package/util/getRelayHandleKey.js.flow +1 -1
  205. package/util/getRequestIdentifier.js.flow +1 -1
  206. package/util/getValueAtPath.js.flow +1 -1
  207. package/util/isEmptyObject.js.flow +1 -1
  208. package/util/isPromise.js.flow +1 -1
  209. package/util/isScalarAndEqual.js.flow +1 -1
  210. package/util/recycleNodesInto.js.flow +1 -1
  211. package/util/registerEnvironmentWithDevTools.js.flow +1 -1
  212. package/util/reportMissingRequiredFields.js.flow +1 -1
  213. package/util/resolveImmediate.js.flow +1 -1
  214. package/util/stableCopy.js.flow +1 -1
  215. package/util/withDuration.js.flow +1 -1
  216. package/util/withProvidedVariables.js.flow +64 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -15,6 +15,7 @@
15
15
  import type {ReaderRelayResolver} from '../util/ReaderNode';
16
16
  import type {DataID, Variables} from '../util/RelayRuntimeTypes';
17
17
  import type {
18
+ MissingRequiredFields,
18
19
  MutableRecordSource,
19
20
  Record,
20
21
  SingularReaderSelector,
@@ -26,6 +27,7 @@ const RelayModernRecord = require('./RelayModernRecord');
26
27
  const {
27
28
  RELAY_RESOLVER_INPUTS_KEY,
28
29
  RELAY_RESOLVER_INVALIDATION_KEY,
30
+ RELAY_RESOLVER_MISSING_REQUIRED_FIELDS_KEY,
29
31
  RELAY_RESOLVER_READER_SELECTOR_KEY,
30
32
  RELAY_RESOLVER_VALUE_KEY,
31
33
  getStorageKey,
@@ -40,6 +42,7 @@ type EvaluationResult<T> = {|
40
42
  resolverID: ResolverID,
41
43
  seenRecordIDs: Set<DataID>,
42
44
  readerSelector: SingularReaderSelector,
45
+ missingRequiredFields: ?MissingRequiredFields,
43
46
  |};
44
47
 
45
48
  export interface ResolverCache {
@@ -49,7 +52,7 @@ export interface ResolverCache {
49
52
  variables: Variables,
50
53
  evaluate: () => EvaluationResult<T>,
51
54
  getDataForResolverFragment: (SingularReaderSelector) => mixed,
52
- ): [T /* Answer */, ?DataID /* Seen record */];
55
+ ): [T /* Answer */, ?DataID /* Seen record */, ?MissingRequiredFields];
53
56
  invalidateDataIDs(
54
57
  updatedDataIDs: Set<DataID>, // Mutated in place
55
58
  ): void;
@@ -65,8 +68,9 @@ class NoopResolverCache implements ResolverCache {
65
68
  variables: Variables,
66
69
  evaluate: () => EvaluationResult<T>,
67
70
  getDataForResolverFragment: SingularReaderSelector => mixed,
68
- ): [T /* Answer */, ?DataID /* Seen record */] {
69
- return [evaluate().resolverResult, undefined];
71
+ ): [T /* Answer */, ?DataID /* Seen record */, ?MissingRequiredFields] {
72
+ const {resolverResult, missingRequiredFields} = evaluate();
73
+ return [resolverResult, undefined, missingRequiredFields];
70
74
  }
71
75
  invalidateDataIDs(updatedDataIDs: Set<DataID>): void {}
72
76
  }
@@ -102,7 +106,7 @@ class RecordResolverCache implements ResolverCache {
102
106
  variables: Variables,
103
107
  evaluate: () => EvaluationResult<T>,
104
108
  getDataForResolverFragment: SingularReaderSelector => mixed,
105
- ): [T /* Answer */, ?DataID /* Seen record */] {
109
+ ): [T /* Answer */, ?DataID /* Seen record */, ?MissingRequiredFields] {
106
110
  const recordSource = this._getRecordSource();
107
111
  const recordID = RelayModernRecord.getDataID(record);
108
112
 
@@ -133,6 +137,11 @@ class RecordResolverCache implements ResolverCache {
133
137
  RELAY_RESOLVER_READER_SELECTOR_KEY,
134
138
  evaluationResult.readerSelector,
135
139
  );
140
+ RelayModernRecord.setValue(
141
+ linkedRecord,
142
+ RELAY_RESOLVER_MISSING_REQUIRED_FIELDS_KEY,
143
+ evaluationResult.missingRequiredFields,
144
+ );
136
145
  recordSource.set(linkedID, linkedRecord);
137
146
 
138
147
  // Link the resolver value record to the resolver field of the record being read:
@@ -155,7 +164,11 @@ class RecordResolverCache implements ResolverCache {
155
164
 
156
165
  // $FlowFixMe[incompatible-type] - will always be empty
157
166
  const answer: T = linkedRecord[RELAY_RESOLVER_VALUE_KEY];
158
- return [answer, linkedID];
167
+
168
+ const missingRequiredFields: ?MissingRequiredFields =
169
+ // $FlowFixMe[incompatible-type] - casting mixed
170
+ linkedRecord[RELAY_RESOLVER_MISSING_REQUIRED_FIELDS_KEY];
171
+ return [answer, linkedID, missingRequiredFields];
159
172
  }
160
173
 
161
174
  invalidateDataIDs(
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -42,9 +42,9 @@ function withResolverContext<T>(context: ResolverContext, cb: () => T): T {
42
42
  // The declarations ensure that the type of the returned data is:
43
43
  // - non-nullable if the provided ref type is non-nullable
44
44
  // - nullable if the provided ref type is nullable
45
- // - array of non-nullable if the privoided ref type is an array of
45
+ // - array of non-nullable if the provided ref type is an array of
46
46
  // non-nullable refs
47
- // - array of nullable if the privoided ref type is an array of nullable refs
47
+ // - array of nullable if the provided ref type is an array of nullable refs
48
48
 
49
49
  declare function readFragment<
50
50
  TKey: {+$data?: mixed, +$fragmentSpreads: FragmentType, ...},
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -30,12 +30,11 @@ const {
30
30
  createOperationDescriptor,
31
31
  } = require('../store/RelayModernOperationDescriptor');
32
32
  const {createReaderSelector} = require('../store/RelayModernSelector');
33
- const RelayFeatureFlags = require('../util/RelayFeatureFlags');
34
33
  const warning = require('warning');
35
34
 
36
35
  export type SubscriptionParameters = {|
37
36
  +response: {...},
38
- +variables: interface {},
37
+ +variables: {...},
39
38
  +rawResponse?: {...},
40
39
  |};
41
40
 
@@ -50,18 +49,13 @@ export type GraphQLSubscriptionConfig<T: SubscriptionParameters> = {|
50
49
  updater?: ?SelectorStoreUpdater<T['response']>,
51
50
  |};
52
51
 
53
- export type DEPRECATED_GraphQLSubscriptionConfig<TSubscriptionPayload> = {|
54
- configs?: Array<DeclarativeMutationConfig>,
55
- cacheConfig?: CacheConfig,
56
- subscription: GraphQLTaggedNode,
57
- variables: Variables,
58
- onCompleted?: ?() => void,
59
- onError?: ?(error: Error) => void,
60
- onNext?: ?(response: ?TSubscriptionPayload) => void,
61
- updater?: ?SelectorStoreUpdater<TSubscriptionPayload>,
62
- |};
52
+ export type DEPRECATED_GraphQLSubscriptionConfig<TSubscriptionPayload: {...}> =
53
+ GraphQLSubscriptionConfig<{|
54
+ response: TSubscriptionPayload,
55
+ variables: Variables,
56
+ |}>;
63
57
 
64
- function requestSubscription<TSubscriptionPayload>(
58
+ function requestSubscription<TSubscriptionPayload: {...}>(
65
59
  environment: IEnvironment,
66
60
  config: DEPRECATED_GraphQLSubscriptionConfig<TSubscriptionPayload>,
67
61
  ): Disposable {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -35,6 +35,8 @@ export type NormalizationRootNode =
35
35
  | ConcreteRequest
36
36
  | NormalizationSplitOperation;
37
37
 
38
+ export type ProvidedVariablesType = {+[key: string]: {|get(): mixed|}};
39
+
38
40
  /**
39
41
  * Contains the parameters required for executing a GraphQL request.
40
42
  * The operation can either be provided as a persisted `id` or `text`. If given
@@ -48,7 +50,7 @@ export type RequestParameters =
48
50
  // common fields
49
51
  +name: string,
50
52
  +operationKind: 'mutation' | 'query' | 'subscription',
51
- +providedVariables?: {|name: string, provider: {|get: () => mixed|}|}[],
53
+ +providedVariables?: ProvidedVariablesType,
52
54
  +metadata: {[key: string]: mixed, ...},
53
55
  |}
54
56
  | {|
@@ -58,7 +60,7 @@ export type RequestParameters =
58
60
  // common fields
59
61
  +name: string,
60
62
  +operationKind: 'mutation' | 'query' | 'subscription',
61
- +providedVariables?: {|name: string, provider: {|get: () => mixed|}|}[],
63
+ +providedVariables?: ProvidedVariablesType,
62
64
  +metadata: {[key: string]: mixed, ...},
63
65
  |};
64
66
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -20,7 +20,6 @@ export type FeatureFlags = {|
20
20
  ENABLE_VARIABLE_CONNECTION_KEY: boolean,
21
21
  ENABLE_PARTIAL_RENDERING_DEFAULT: boolean,
22
22
  ENABLE_REACT_FLIGHT_COMPONENT_FIELD: boolean,
23
- ENABLE_REQUIRED_DIRECTIVES: boolean | string,
24
23
  ENABLE_RELAY_RESOLVERS: boolean,
25
24
  ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION: boolean,
26
25
  ENABLE_FRIENDLY_QUERY_NAME_GQL_URL: boolean,
@@ -42,7 +41,6 @@ const RelayFeatureFlags: FeatureFlags = {
42
41
  ENABLE_VARIABLE_CONNECTION_KEY: false,
43
42
  ENABLE_PARTIAL_RENDERING_DEFAULT: true,
44
43
  ENABLE_REACT_FLIGHT_COMPONENT_FIELD: false,
45
- ENABLE_REQUIRED_DIRECTIVES: false,
46
44
  ENABLE_RELAY_RESOLVERS: false,
47
45
  ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION: false,
48
46
  ENABLE_FRIENDLY_QUERY_NAME_GQL_URL: false,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -13,11 +13,8 @@
13
13
 
14
14
  'use strict';
15
15
 
16
- import type {
17
- ConcreteRequest,
18
- ReaderFragment,
19
- ReaderPaginationMetadata,
20
- } from 'relay-runtime';
16
+ import type {ReaderFragment, ReaderPaginationMetadata} from './ReaderNode';
17
+ import type {ConcreteRequest} from './RelayConcreteNode';
21
18
 
22
19
  const getRefetchMetadata = require('./getRefetchMetadata');
23
20
  const invariant = require('invariant');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -13,11 +13,8 @@
13
13
 
14
14
  'use strict';
15
15
 
16
- import type {
17
- ConcreteRequest,
18
- ReaderFragment,
19
- ReaderRefetchMetadata,
20
- } from 'relay-runtime';
16
+ import type {ReaderFragment, ReaderRefetchMetadata} from './ReaderNode';
17
+ import type {ConcreteRequest} from './RelayConcreteNode';
21
18
 
22
19
  const invariant = require('invariant');
23
20
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.