@ardatan/relay-compiler 12.0.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 (256) hide show
  1. package/LICENSE +21 -0
  2. package/bin/RelayCompilerBin.js.flow +169 -0
  3. package/bin/RelayCompilerMain.js.flow +515 -0
  4. package/bin/__fixtures__/plugin-module.js.flow +17 -0
  5. package/bin/relay-compiler +19066 -0
  6. package/codegen/CodegenDirectory.js.flow +375 -0
  7. package/codegen/CodegenRunner.js.flow +432 -0
  8. package/codegen/CodegenTypes.js.flow +28 -0
  9. package/codegen/CodegenWatcher.js.flow +254 -0
  10. package/codegen/NormalizationCodeGenerator.js.flow +566 -0
  11. package/codegen/ReaderCodeGenerator.js.flow +512 -0
  12. package/codegen/RelayCodeGenerator.js.flow +85 -0
  13. package/codegen/RelayFileWriter.js.flow +367 -0
  14. package/codegen/SourceControl.js.flow +58 -0
  15. package/codegen/compileRelayArtifacts.js.flow +182 -0
  16. package/codegen/createPrintRequireModuleDependency.js.flow +19 -0
  17. package/codegen/sortObjectByKey.js.flow +25 -0
  18. package/codegen/writeRelayGeneratedFile.js.flow +239 -0
  19. package/core/ASTCache.js.flow +74 -0
  20. package/core/ASTConvert.js.flow +233 -0
  21. package/core/CompilerContext.js.flow +191 -0
  22. package/core/CompilerError.js.flow +255 -0
  23. package/core/DotGraphQLParser.js.flow +39 -0
  24. package/core/GraphQLCompilerProfiler.js.flow +341 -0
  25. package/core/GraphQLDerivedFromMetadata.js.flow +36 -0
  26. package/core/GraphQLWatchmanClient.js.flow +111 -0
  27. package/core/IR.js.flow +326 -0
  28. package/core/IRPrinter.js.flow +478 -0
  29. package/core/IRTransformer.js.flow +377 -0
  30. package/core/IRValidator.js.flow +260 -0
  31. package/core/IRVisitor.js.flow +150 -0
  32. package/core/JSModuleParser.js.flow +24 -0
  33. package/core/RelayCompilerScope.js.flow +199 -0
  34. package/core/RelayFindGraphQLTags.js.flow +119 -0
  35. package/core/RelayGraphQLEnumsGenerator.js.flow +55 -0
  36. package/core/RelayIRTransforms.js.flow +138 -0
  37. package/core/RelayParser.js.flow +1734 -0
  38. package/core/RelaySourceModuleParser.js.flow +135 -0
  39. package/core/Schema.js.flow +2037 -0
  40. package/core/SchemaUtils.js.flow +120 -0
  41. package/core/filterContextForNode.js.flow +50 -0
  42. package/core/getFieldDefinition.js.flow +156 -0
  43. package/core/getIdentifierForArgumentValue.js.flow +49 -0
  44. package/core/getIdentifierForSelection.js.flow +69 -0
  45. package/core/getLiteralArgumentValues.js.flow +32 -0
  46. package/core/getNormalizationOperationName.js.flow +19 -0
  47. package/core/inferRootArgumentDefinitions.js.flow +323 -0
  48. package/index.js +10 -0
  49. package/index.js.flow +200 -0
  50. package/language/RelayLanguagePluginInterface.js.flow +283 -0
  51. package/language/javascript/FindGraphQLTags.js.flow +137 -0
  52. package/language/javascript/RelayFlowBabelFactories.js.flow +176 -0
  53. package/language/javascript/RelayFlowGenerator.js.flow +1100 -0
  54. package/language/javascript/RelayFlowTypeTransformers.js.flow +184 -0
  55. package/language/javascript/RelayLanguagePluginJavaScript.js.flow +34 -0
  56. package/language/javascript/formatGeneratedModule.js.flow +65 -0
  57. package/lib/bin/RelayCompilerBin.js +143 -0
  58. package/lib/bin/RelayCompilerMain.js +486 -0
  59. package/lib/bin/__fixtures__/plugin-module.js +16 -0
  60. package/lib/codegen/CodegenDirectory.js +336 -0
  61. package/lib/codegen/CodegenRunner.js +433 -0
  62. package/lib/codegen/CodegenTypes.js +11 -0
  63. package/lib/codegen/CodegenWatcher.js +271 -0
  64. package/lib/codegen/NormalizationCodeGenerator.js +480 -0
  65. package/lib/codegen/ReaderCodeGenerator.js +472 -0
  66. package/lib/codegen/RelayCodeGenerator.js +68 -0
  67. package/lib/codegen/RelayFileWriter.js +270 -0
  68. package/lib/codegen/SourceControl.js +60 -0
  69. package/lib/codegen/compileRelayArtifacts.js +157 -0
  70. package/lib/codegen/createPrintRequireModuleDependency.js +19 -0
  71. package/lib/codegen/sortObjectByKey.js +41 -0
  72. package/lib/codegen/writeRelayGeneratedFile.js +208 -0
  73. package/lib/core/ASTCache.js +70 -0
  74. package/lib/core/ASTConvert.js +198 -0
  75. package/lib/core/CompilerContext.js +165 -0
  76. package/lib/core/CompilerError.js +251 -0
  77. package/lib/core/DotGraphQLParser.js +40 -0
  78. package/lib/core/GraphQLCompilerProfiler.js +299 -0
  79. package/lib/core/GraphQLDerivedFromMetadata.js +31 -0
  80. package/lib/core/GraphQLWatchmanClient.js +150 -0
  81. package/lib/core/IR.js +11 -0
  82. package/lib/core/IRPrinter.js +389 -0
  83. package/lib/core/IRTransformer.js +345 -0
  84. package/lib/core/IRValidator.js +226 -0
  85. package/lib/core/IRVisitor.js +45 -0
  86. package/lib/core/JSModuleParser.js +18 -0
  87. package/lib/core/RelayCompilerScope.js +149 -0
  88. package/lib/core/RelayFindGraphQLTags.js +79 -0
  89. package/lib/core/RelayGraphQLEnumsGenerator.js +50 -0
  90. package/lib/core/RelayIRTransforms.js +109 -0
  91. package/lib/core/RelayParser.js +1382 -0
  92. package/lib/core/RelaySourceModuleParser.js +104 -0
  93. package/lib/core/Schema.js +1877 -0
  94. package/lib/core/SchemaUtils.js +98 -0
  95. package/lib/core/filterContextForNode.js +49 -0
  96. package/lib/core/getFieldDefinition.js +145 -0
  97. package/lib/core/getIdentifierForArgumentValue.js +53 -0
  98. package/lib/core/getIdentifierForSelection.js +48 -0
  99. package/lib/core/getLiteralArgumentValues.js +26 -0
  100. package/lib/core/getNormalizationOperationName.js +17 -0
  101. package/lib/core/inferRootArgumentDefinitions.js +351 -0
  102. package/lib/index.js +178 -0
  103. package/lib/language/RelayLanguagePluginInterface.js +14 -0
  104. package/lib/language/javascript/FindGraphQLTags.js +126 -0
  105. package/lib/language/javascript/RelayFlowBabelFactories.js +160 -0
  106. package/lib/language/javascript/RelayFlowGenerator.js +857 -0
  107. package/lib/language/javascript/RelayFlowTypeTransformers.js +119 -0
  108. package/lib/language/javascript/RelayLanguagePluginJavaScript.js +30 -0
  109. package/lib/language/javascript/formatGeneratedModule.js +36 -0
  110. package/lib/reporters/ConsoleReporter.js +61 -0
  111. package/lib/reporters/MultiReporter.js +45 -0
  112. package/lib/reporters/Reporter.js +11 -0
  113. package/lib/runner/Artifacts.js +323 -0
  114. package/lib/runner/BufferedFilesystem.js +261 -0
  115. package/lib/runner/GraphQLASTNodeGroup.js +256 -0
  116. package/lib/runner/GraphQLASTUtils.js +23 -0
  117. package/lib/runner/GraphQLNodeMap.js +81 -0
  118. package/lib/runner/Sources.js +271 -0
  119. package/lib/runner/StrictMap.js +134 -0
  120. package/lib/runner/compileArtifacts.js +39 -0
  121. package/lib/runner/extractAST.js +77 -0
  122. package/lib/runner/getChangedNodeNames.js +82 -0
  123. package/lib/runner/getSchemaInstance.js +30 -0
  124. package/lib/runner/types.js +12 -0
  125. package/lib/transforms/ApplyFragmentArgumentTransform.js +393 -0
  126. package/lib/transforms/ClientExtensionsTransform.js +222 -0
  127. package/lib/transforms/ConnectionTransform.js +643 -0
  128. package/lib/transforms/DeclarativeConnectionMutationTransform.js +221 -0
  129. package/lib/transforms/DeferStreamTransform.js +247 -0
  130. package/lib/transforms/DisallowIdAsAlias.js +41 -0
  131. package/lib/transforms/DisallowTypenameOnRoot.js +53 -0
  132. package/lib/transforms/FieldHandleTransform.js +81 -0
  133. package/lib/transforms/FilterCompilerDirectivesTransform.js +29 -0
  134. package/lib/transforms/FilterDirectivesTransform.js +41 -0
  135. package/lib/transforms/FlattenTransform.js +308 -0
  136. package/lib/transforms/GenerateIDFieldTransform.js +137 -0
  137. package/lib/transforms/GenerateTypeNameTransform.js +155 -0
  138. package/lib/transforms/InlineDataFragmentTransform.js +104 -0
  139. package/lib/transforms/InlineFragmentsTransform.js +63 -0
  140. package/lib/transforms/MaskTransform.js +121 -0
  141. package/lib/transforms/MatchTransform.js +438 -0
  142. package/lib/transforms/ReactFlightComponentTransform.js +161 -0
  143. package/lib/transforms/RefetchableFragmentTransform.js +249 -0
  144. package/lib/transforms/RelayDirectiveTransform.js +85 -0
  145. package/lib/transforms/RequiredFieldTransform.js +373 -0
  146. package/lib/transforms/SkipClientExtensionsTransform.js +49 -0
  147. package/lib/transforms/SkipHandleFieldTransform.js +45 -0
  148. package/lib/transforms/SkipRedundantNodesTransform.js +255 -0
  149. package/lib/transforms/SkipSplitOperationTransform.js +32 -0
  150. package/lib/transforms/SkipUnreachableNodeTransform.js +158 -0
  151. package/lib/transforms/SkipUnusedVariablesTransform.js +74 -0
  152. package/lib/transforms/SplitModuleImportTransform.js +85 -0
  153. package/lib/transforms/TestOperationTransform.js +145 -0
  154. package/lib/transforms/TransformUtils.js +21 -0
  155. package/lib/transforms/ValidateGlobalVariablesTransform.js +91 -0
  156. package/lib/transforms/ValidateRequiredArgumentsTransform.js +118 -0
  157. package/lib/transforms/ValidateServerOnlyDirectivesTransform.js +111 -0
  158. package/lib/transforms/ValidateUnusedVariablesTransform.js +96 -0
  159. package/lib/transforms/query-generators/FetchableQueryGenerator.js +157 -0
  160. package/lib/transforms/query-generators/NodeQueryGenerator.js +166 -0
  161. package/lib/transforms/query-generators/QueryQueryGenerator.js +48 -0
  162. package/lib/transforms/query-generators/ViewerQueryGenerator.js +77 -0
  163. package/lib/transforms/query-generators/index.js +60 -0
  164. package/lib/transforms/query-generators/utils.js +92 -0
  165. package/lib/util/CodeMarker.js +80 -0
  166. package/lib/util/DefaultHandleKey.js +15 -0
  167. package/lib/util/RelayCompilerCache.js +98 -0
  168. package/lib/util/Rollout.js +40 -0
  169. package/lib/util/TimeReporter.js +83 -0
  170. package/lib/util/areEqualArgValues.js +135 -0
  171. package/lib/util/argumentContainsVariables.js +37 -0
  172. package/lib/util/dedupeJSONStringify.js +160 -0
  173. package/lib/util/generateAbstractTypeRefinementKey.js +24 -0
  174. package/lib/util/getDefinitionNodeHash.js +22 -0
  175. package/lib/util/getModuleName.js +32 -0
  176. package/lib/util/joinArgumentDefinitions.js +66 -0
  177. package/lib/util/md5.js +17 -0
  178. package/lib/util/murmurHash.js +86 -0
  179. package/lib/util/nullthrowsOSS.js +23 -0
  180. package/lib/util/orList.js +36 -0
  181. package/lib/util/partitionArray.js +35 -0
  182. package/package.json +42 -0
  183. package/relay-compiler.js +17 -0
  184. package/relay-compiler.min.js +22 -0
  185. package/reporters/ConsoleReporter.js.flow +81 -0
  186. package/reporters/MultiReporter.js.flow +43 -0
  187. package/reporters/Reporter.js.flow +19 -0
  188. package/runner/Artifacts.js.flow +219 -0
  189. package/runner/BufferedFilesystem.js.flow +194 -0
  190. package/runner/GraphQLASTNodeGroup.js.flow +176 -0
  191. package/runner/GraphQLASTUtils.js.flow +26 -0
  192. package/runner/GraphQLNodeMap.js.flow +55 -0
  193. package/runner/Sources.js.flow +228 -0
  194. package/runner/StrictMap.js.flow +96 -0
  195. package/runner/compileArtifacts.js.flow +76 -0
  196. package/runner/extractAST.js.flow +100 -0
  197. package/runner/getChangedNodeNames.js.flow +48 -0
  198. package/runner/getSchemaInstance.js.flow +36 -0
  199. package/runner/types.js.flow +37 -0
  200. package/transforms/ApplyFragmentArgumentTransform.js.flow +526 -0
  201. package/transforms/ClientExtensionsTransform.js.flow +226 -0
  202. package/transforms/ConnectionTransform.js.flow +859 -0
  203. package/transforms/DeclarativeConnectionMutationTransform.js.flow +250 -0
  204. package/transforms/DeferStreamTransform.js.flow +266 -0
  205. package/transforms/DisallowIdAsAlias.js.flow +48 -0
  206. package/transforms/DisallowTypenameOnRoot.js.flow +45 -0
  207. package/transforms/FieldHandleTransform.js.flow +81 -0
  208. package/transforms/FilterCompilerDirectivesTransform.js.flow +33 -0
  209. package/transforms/FilterDirectivesTransform.js.flow +45 -0
  210. package/transforms/FlattenTransform.js.flow +462 -0
  211. package/transforms/GenerateIDFieldTransform.js.flow +154 -0
  212. package/transforms/GenerateTypeNameTransform.js.flow +167 -0
  213. package/transforms/InlineDataFragmentTransform.js.flow +129 -0
  214. package/transforms/InlineFragmentsTransform.js.flow +73 -0
  215. package/transforms/MaskTransform.js.flow +130 -0
  216. package/transforms/MatchTransform.js.flow +593 -0
  217. package/transforms/ReactFlightComponentTransform.js.flow +198 -0
  218. package/transforms/RefetchableFragmentTransform.js.flow +272 -0
  219. package/transforms/RelayDirectiveTransform.js.flow +99 -0
  220. package/transforms/RequiredFieldTransform.js.flow +419 -0
  221. package/transforms/SkipClientExtensionsTransform.js.flow +57 -0
  222. package/transforms/SkipHandleFieldTransform.js.flow +45 -0
  223. package/transforms/SkipRedundantNodesTransform.js.flow +259 -0
  224. package/transforms/SkipSplitOperationTransform.js.flow +37 -0
  225. package/transforms/SkipUnreachableNodeTransform.js.flow +149 -0
  226. package/transforms/SkipUnusedVariablesTransform.js.flow +59 -0
  227. package/transforms/SplitModuleImportTransform.js.flow +101 -0
  228. package/transforms/TestOperationTransform.js.flow +143 -0
  229. package/transforms/TransformUtils.js.flow +26 -0
  230. package/transforms/ValidateGlobalVariablesTransform.js.flow +81 -0
  231. package/transforms/ValidateRequiredArgumentsTransform.js.flow +131 -0
  232. package/transforms/ValidateServerOnlyDirectivesTransform.js.flow +115 -0
  233. package/transforms/ValidateUnusedVariablesTransform.js.flow +89 -0
  234. package/transforms/query-generators/FetchableQueryGenerator.js.flow +189 -0
  235. package/transforms/query-generators/NodeQueryGenerator.js.flow +219 -0
  236. package/transforms/query-generators/QueryQueryGenerator.js.flow +57 -0
  237. package/transforms/query-generators/ViewerQueryGenerator.js.flow +97 -0
  238. package/transforms/query-generators/index.js.flow +90 -0
  239. package/transforms/query-generators/utils.js.flow +76 -0
  240. package/util/CodeMarker.js.flow +79 -0
  241. package/util/DefaultHandleKey.js.flow +17 -0
  242. package/util/RelayCompilerCache.js.flow +88 -0
  243. package/util/Rollout.js.flow +39 -0
  244. package/util/TimeReporter.js.flow +79 -0
  245. package/util/areEqualArgValues.js.flow +126 -0
  246. package/util/argumentContainsVariables.js.flow +38 -0
  247. package/util/dedupeJSONStringify.js.flow +152 -0
  248. package/util/generateAbstractTypeRefinementKey.js.flow +29 -0
  249. package/util/getDefinitionNodeHash.js.flow +25 -0
  250. package/util/getModuleName.js.flow +39 -0
  251. package/util/joinArgumentDefinitions.js.flow +105 -0
  252. package/util/md5.js.flow +22 -0
  253. package/util/murmurHash.js.flow +94 -0
  254. package/util/nullthrowsOSS.js.flow +25 -0
  255. package/util/orList.js.flow +37 -0
  256. package/util/partitionArray.js.flow +37 -0
@@ -0,0 +1,859 @@
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 IRTransformer = require('../core/IRTransformer');
16
+ const RelayParser = require('../core/RelayParser');
17
+ const SchemaUtils = require('../core/SchemaUtils');
18
+
19
+ const getLiteralArgumentValues = require('../core/getLiteralArgumentValues');
20
+
21
+ const {createCompilerError, createUserError} = require('../core/CompilerError');
22
+ const {parse} = require('graphql');
23
+ const {ConnectionInterface, RelayFeatureFlags} = require('relay-runtime');
24
+
25
+ import type CompilerContext from '../core/CompilerContext';
26
+ import type {
27
+ Argument,
28
+ Directive,
29
+ Fragment,
30
+ Handle,
31
+ InlineFragment,
32
+ LinkedField,
33
+ Root,
34
+ Selection,
35
+ Variable,
36
+ Location,
37
+ Defer,
38
+ } from '../core/IR';
39
+ import type {Schema, CompositeTypeID} from '../core/Schema';
40
+ import type {ConnectionMetadata} from 'relay-runtime';
41
+
42
+ type Options = {
43
+ documentName: string,
44
+ // The current path
45
+ path: Array<?string>,
46
+ // Metadata recorded for @connection fields
47
+ connectionMetadata: Array<ConnectionMetadata>,
48
+ ...
49
+ };
50
+
51
+ type ConnectionArguments = {|
52
+ handler: ?string,
53
+ key: string,
54
+ dynamicKey: Variable | null,
55
+ filters: ?$ReadOnlyArray<string>,
56
+ stream: ?{|
57
+ if: ?Argument,
58
+ initialCount: ?Argument,
59
+ useCustomizedBatch: ?Argument,
60
+ label: string,
61
+ |},
62
+ |};
63
+
64
+ const AFTER = 'after';
65
+ const BEFORE = 'before';
66
+ const FIRST = 'first';
67
+ const KEY = 'key';
68
+ const LAST = 'last';
69
+
70
+ const CONNECTION = 'connection';
71
+ const STREAM_CONNECTION = 'stream_connection';
72
+ const HANDLER = 'handler';
73
+
74
+ /**
75
+ * @public
76
+ *
77
+ * Transforms fields with the `@connection` directive:
78
+ * - Verifies that the field type is connection-like.
79
+ * - Adds a `handle` property to the field, either the user-provided `handle`
80
+ * argument or the default value "connection".
81
+ * - Inserts a sub-fragment on the field to ensure that standard connection
82
+ * fields are fetched (e.g. cursors, node ids, page info).
83
+ */
84
+ function connectionTransform(context: CompilerContext): CompilerContext {
85
+ return IRTransformer.transform(
86
+ context,
87
+ {
88
+ Fragment: visitFragmentOrRoot,
89
+ LinkedField: visitLinkedField,
90
+ Root: visitFragmentOrRoot,
91
+ },
92
+ node => ({
93
+ documentName: node.name,
94
+ path: [],
95
+ connectionMetadata: [],
96
+ }),
97
+ );
98
+ }
99
+
100
+ const SCHEMA_EXTENSION = `
101
+ directive @connection(
102
+ key: String!
103
+ filters: [String]
104
+ handler: String
105
+ dynamicKey_UNSTABLE: String
106
+ ) on FIELD
107
+
108
+ directive @stream_connection(
109
+ key: String!
110
+ filters: [String]
111
+ handler: String
112
+ initial_count: Int!
113
+ if: Boolean = true
114
+ use_customized_batch: Boolean = false
115
+ dynamicKey_UNSTABLE: String
116
+ ) on FIELD
117
+ `;
118
+
119
+ /**
120
+ * @internal
121
+ */
122
+ function visitFragmentOrRoot<N: Fragment | Root>(
123
+ node: N,
124
+ options: Options,
125
+ ): ?N {
126
+ // $FlowFixMe[incompatible-use]
127
+ const transformedNode = this.traverse(node, options);
128
+ const connectionMetadata = options.connectionMetadata;
129
+ if (connectionMetadata.length) {
130
+ return {
131
+ ...transformedNode,
132
+ metadata: {
133
+ ...transformedNode.metadata,
134
+ connection: connectionMetadata,
135
+ },
136
+ };
137
+ }
138
+ return transformedNode;
139
+ }
140
+
141
+ /**
142
+ * @internal
143
+ */
144
+ function visitLinkedField(field: LinkedField, options: Options): LinkedField {
145
+ // $FlowFixMe[incompatible-use]
146
+ const context: CompilerContext = this.getContext();
147
+ const schema = context.getSchema();
148
+
149
+ const nullableType = schema.getNullableType(field.type);
150
+
151
+ const isPlural = schema.isList(nullableType);
152
+ const path = options.path.concat(isPlural ? null : field.alias || field.name);
153
+ // $FlowFixMe[incompatible-use]
154
+ let transformedField: LinkedField = this.traverse(field, {
155
+ ...options,
156
+ path,
157
+ });
158
+ const connectionDirective = field.directives.find(
159
+ directive =>
160
+ directive.name === CONNECTION || directive.name === STREAM_CONNECTION,
161
+ );
162
+ if (!connectionDirective) {
163
+ return transformedField;
164
+ }
165
+ if (!schema.isObject(nullableType) && !schema.isInterface(nullableType)) {
166
+ throw new createUserError(
167
+ `@${connectionDirective.name} used on invalid field '${field.name}'. ` +
168
+ 'Expected the return type to be a non-plural interface or object, ' +
169
+ `got '${schema.getTypeString(field.type)}'.`,
170
+ [transformedField.loc],
171
+ );
172
+ }
173
+
174
+ validateConnectionSelection(transformedField);
175
+ validateConnectionType(
176
+ schema,
177
+ transformedField,
178
+ schema.assertCompositeType(nullableType),
179
+ connectionDirective,
180
+ );
181
+
182
+ const connectionArguments = buildConnectionArguments(
183
+ transformedField,
184
+ connectionDirective,
185
+ );
186
+
187
+ const connectionMetadata = buildConnectionMetadata(
188
+ transformedField,
189
+ path,
190
+ connectionArguments.stream != null,
191
+ );
192
+ options.connectionMetadata.push(connectionMetadata);
193
+
194
+ const handle: Handle = {
195
+ name: connectionArguments.handler ?? CONNECTION,
196
+ key: connectionArguments.key,
197
+ dynamicKey: connectionArguments.dynamicKey,
198
+ filters: connectionArguments.filters,
199
+ };
200
+
201
+ const {direction} = connectionMetadata;
202
+ if (direction != null) {
203
+ const selections = transformConnectionSelections(
204
+ // $FlowFixMe[incompatible-use]
205
+ this.getContext(),
206
+ transformedField,
207
+ schema.assertCompositeType(nullableType),
208
+ direction,
209
+ connectionArguments,
210
+ connectionDirective.loc,
211
+ options.documentName,
212
+ );
213
+ transformedField = {
214
+ ...transformedField,
215
+ selections,
216
+ };
217
+ }
218
+ return {
219
+ ...transformedField,
220
+ directives: transformedField.directives.filter(
221
+ directive => directive !== connectionDirective,
222
+ ),
223
+ connection: true,
224
+ handles: transformedField.handles
225
+ ? [...transformedField.handles, handle]
226
+ : [handle],
227
+ };
228
+ }
229
+
230
+ function buildConnectionArguments(
231
+ field: LinkedField,
232
+ connectionDirective: Directive,
233
+ ): ConnectionArguments {
234
+ const {
235
+ handler,
236
+ key,
237
+ label,
238
+ filters: literalFilters,
239
+ } = getLiteralArgumentValues(connectionDirective.args);
240
+ if (handler != null && typeof handler !== 'string') {
241
+ const handleArg = connectionDirective.args.find(
242
+ arg => arg.name === 'handler',
243
+ );
244
+ throw createUserError(
245
+ `Expected the ${HANDLER} argument to @${connectionDirective.name} to ` +
246
+ `be a string literal for field ${field.name}.`,
247
+ [handleArg?.value?.loc ?? connectionDirective.loc],
248
+ );
249
+ }
250
+ if (typeof key !== 'string') {
251
+ const keyArg = connectionDirective.args.find(arg => arg.name === 'key');
252
+ throw createUserError(
253
+ `Expected the ${KEY} argument to @${connectionDirective.name} to be a ` +
254
+ `string literal for field ${field.name}.`,
255
+ [keyArg?.value?.loc ?? connectionDirective.loc],
256
+ );
257
+ }
258
+ const postfix = field.alias || field.name;
259
+ if (!key.endsWith('_' + postfix)) {
260
+ const keyArg = connectionDirective.args.find(arg => arg.name === 'key');
261
+ throw createUserError(
262
+ `Expected the ${KEY} argument to @${connectionDirective.name} to be of ` +
263
+ `form <SomeName>_${postfix}, got '${key}'. ` +
264
+ 'For a detailed explanation, check out ' +
265
+ 'https://relay.dev/docs/en/pagination-container#connection',
266
+ [keyArg?.value?.loc ?? connectionDirective.loc],
267
+ );
268
+ }
269
+ if (
270
+ literalFilters != null &&
271
+ (!Array.isArray(literalFilters) ||
272
+ literalFilters.some(filter => typeof filter !== 'string'))
273
+ ) {
274
+ const filtersArg = connectionDirective.args.find(
275
+ arg => arg.name === 'filters',
276
+ );
277
+ throw createUserError(
278
+ `Expected the 'filters' argument to @${connectionDirective.name} to be ` +
279
+ 'a string literal.',
280
+ [filtersArg?.value?.loc ?? connectionDirective.loc],
281
+ );
282
+ }
283
+
284
+ let filters = literalFilters;
285
+ if (filters == null) {
286
+ const generatedFilters = field.args
287
+ .filter(
288
+ arg =>
289
+ !ConnectionInterface.isConnectionCall({
290
+ name: arg.name,
291
+ value: null,
292
+ }),
293
+ )
294
+ .map(arg => arg.name);
295
+ filters = generatedFilters.length !== 0 ? generatedFilters : null;
296
+ }
297
+
298
+ let stream = null;
299
+ if (connectionDirective.name === STREAM_CONNECTION) {
300
+ const initialCountArg = connectionDirective.args.find(
301
+ arg => arg.name === 'initial_count',
302
+ );
303
+ const useCustomizedBatchArg = connectionDirective.args.find(
304
+ arg => arg.name === 'use_customized_batch',
305
+ );
306
+ const ifArg = connectionDirective.args.find(arg => arg.name === 'if');
307
+ stream = {
308
+ if: ifArg,
309
+ initialCount: initialCountArg,
310
+ useCustomizedBatch: useCustomizedBatchArg,
311
+ label: key,
312
+ };
313
+ }
314
+
315
+ const dynamicKeyArg = connectionDirective.args.find(
316
+ arg => arg.name === 'dynamicKey_UNSTABLE',
317
+ );
318
+ let dynamicKey: Variable | null = null;
319
+ if (dynamicKeyArg != null) {
320
+ if (
321
+ RelayFeatureFlags.ENABLE_VARIABLE_CONNECTION_KEY &&
322
+ dynamicKeyArg.value.kind === 'Variable'
323
+ ) {
324
+ dynamicKey = dynamicKeyArg.value;
325
+ } else {
326
+ throw createUserError(
327
+ `Unsupported 'dynamicKey_UNSTABLE' argument to @${connectionDirective.name}. This argument is only valid when the feature flag is enabled and ` +
328
+ 'the variable must be a variable',
329
+ [connectionDirective.loc],
330
+ );
331
+ }
332
+ }
333
+
334
+ return {
335
+ handler,
336
+ key,
337
+ dynamicKey,
338
+ filters: (filters: $FlowFixMe),
339
+ stream,
340
+ };
341
+ }
342
+
343
+ function buildConnectionMetadata(
344
+ field: LinkedField,
345
+ path: Array<?string>,
346
+ stream: boolean,
347
+ ): ConnectionMetadata {
348
+ const pathHasPlural = path.includes(null);
349
+ const firstArg = findArg(field, FIRST);
350
+ const lastArg = findArg(field, LAST);
351
+ let direction = null;
352
+ let countArg = null;
353
+ let cursorArg = null;
354
+ if (firstArg && !lastArg) {
355
+ direction = 'forward';
356
+ countArg = firstArg;
357
+ cursorArg = findArg(field, AFTER);
358
+ } else if (lastArg && !firstArg) {
359
+ direction = 'backward';
360
+ countArg = lastArg;
361
+ cursorArg = findArg(field, BEFORE);
362
+ } else if (lastArg && firstArg) {
363
+ direction = 'bidirectional';
364
+ // TODO(T26511885) Maybe add connection metadata to this case
365
+ }
366
+ const countVariable =
367
+ countArg && countArg.value.kind === 'Variable'
368
+ ? countArg.value.variableName
369
+ : null;
370
+ const cursorVariable =
371
+ cursorArg && cursorArg.value.kind === 'Variable'
372
+ ? cursorArg.value.variableName
373
+ : null;
374
+ if (stream) {
375
+ return {
376
+ count: countVariable,
377
+ cursor: cursorVariable,
378
+ direction,
379
+ path: pathHasPlural ? null : (path: $FlowFixMe),
380
+ stream: true,
381
+ };
382
+ }
383
+ return {
384
+ count: countVariable,
385
+ cursor: cursorVariable,
386
+ direction,
387
+ path: pathHasPlural ? null : (path: $FlowFixMe),
388
+ };
389
+ }
390
+
391
+ /**
392
+ * @internal
393
+ *
394
+ * Transforms the selections on a connection field, generating fields necessary
395
+ * for pagination (edges.cursor, pageInfo, etc) and adding/merging them with
396
+ * existing selections.
397
+ */
398
+ function transformConnectionSelections(
399
+ context: CompilerContext,
400
+ field: LinkedField,
401
+ nullableType: CompositeTypeID,
402
+ direction: 'forward' | 'backward' | 'bidirectional',
403
+ connectionArguments: ConnectionArguments,
404
+ directiveLocation: Location,
405
+ documentName: string,
406
+ ): $ReadOnlyArray<Selection> {
407
+ const schema = context.getSchema();
408
+ const derivedFieldLocation = {kind: 'Derived', source: field.loc};
409
+ const derivedDirectiveLocation = {
410
+ kind: 'Derived',
411
+ source: directiveLocation,
412
+ };
413
+ const {
414
+ CURSOR,
415
+ EDGES,
416
+ END_CURSOR,
417
+ HAS_NEXT_PAGE,
418
+ HAS_PREV_PAGE,
419
+ NODE,
420
+ PAGE_INFO,
421
+ START_CURSOR,
422
+ } = ConnectionInterface.get();
423
+
424
+ // Find existing edges/pageInfo selections
425
+ let edgesSelection: ?LinkedField;
426
+ let pageInfoSelection: ?LinkedField;
427
+ field.selections.forEach(selection => {
428
+ if (selection.kind === 'LinkedField') {
429
+ if (selection.name === EDGES) {
430
+ if (edgesSelection != null) {
431
+ throw createCompilerError(
432
+ `ConnectionTransform: Unexpected duplicate field '${EDGES}'.`,
433
+ [edgesSelection.loc, selection.loc],
434
+ );
435
+ }
436
+ edgesSelection = selection;
437
+ return;
438
+ } else if (selection.name === PAGE_INFO) {
439
+ if (pageInfoSelection != null) {
440
+ throw createCompilerError(
441
+ `ConnectionTransform: Unexpected duplicate field '${PAGE_INFO}'.`,
442
+ [pageInfoSelection.loc, selection.loc],
443
+ );
444
+ }
445
+ pageInfoSelection = selection;
446
+ return;
447
+ }
448
+ }
449
+ });
450
+ // If streaming is enabled, construct directives to apply to the edges/
451
+ // pageInfo fields
452
+ let streamDirective;
453
+ const stream = connectionArguments.stream;
454
+ if (stream != null) {
455
+ streamDirective = {
456
+ args: [
457
+ stream.if,
458
+ stream.initialCount,
459
+ stream.useCustomizedBatch,
460
+ {
461
+ kind: 'Argument',
462
+ loc: derivedDirectiveLocation,
463
+ name: 'label',
464
+ type: SchemaUtils.getNullableStringInput(schema),
465
+ value: {
466
+ kind: 'Literal',
467
+ loc: derivedDirectiveLocation,
468
+ value: stream.label,
469
+ },
470
+ },
471
+ ].filter(Boolean),
472
+ kind: 'Directive',
473
+ loc: derivedDirectiveLocation,
474
+ name: 'stream',
475
+ };
476
+ }
477
+ // For backwards compatibility with earlier versions of this transform,
478
+ // edges/pageInfo have to be generated as non-aliased fields (since product
479
+ // code may be accessing the non-aliased response keys). But for streaming
480
+ // mode we need to generate @stream/@defer directives on these fields *and*
481
+ // we prefer to avoid generating extra selections (we want one payload per
482
+ // item, not two as could happen with separate @stream directives on the
483
+ // aliased and non-aliased edges fields). So we keep things simple by
484
+ // disallowing aliases on edges/pageInfo in streaming mode.
485
+ if (edgesSelection && edgesSelection.alias !== edgesSelection.name) {
486
+ if (stream) {
487
+ throw createUserError(
488
+ `@stream_connection does not support aliasing the '${EDGES}' field.`,
489
+ [edgesSelection.loc],
490
+ );
491
+ }
492
+ edgesSelection = null;
493
+ }
494
+ if (pageInfoSelection && pageInfoSelection.alias !== pageInfoSelection.name) {
495
+ if (stream) {
496
+ throw createUserError(
497
+ `@stream_connection does not support aliasing the '${PAGE_INFO}' field.`,
498
+ [pageInfoSelection.loc],
499
+ );
500
+ }
501
+ pageInfoSelection = null;
502
+ }
503
+
504
+ // Separately create transformed versions of edges/pageInfo so that we can
505
+ // later replace the originals at the same point within the selection array
506
+ let transformedEdgesSelection: ?LinkedField = edgesSelection;
507
+ let transformedPageInfoSelection: ?(
508
+ | Defer
509
+ | InlineFragment
510
+ | LinkedField
511
+ ) = pageInfoSelection;
512
+ const edgesType = schema.getFieldConfig(
513
+ schema.expectField(nullableType, EDGES),
514
+ ).type;
515
+
516
+ const pageInfoType = schema.getFieldConfig(
517
+ schema.expectField(nullableType, PAGE_INFO),
518
+ ).type;
519
+
520
+ if (transformedEdgesSelection == null) {
521
+ transformedEdgesSelection = {
522
+ alias: EDGES,
523
+ args: [],
524
+ connection: false,
525
+ directives: [],
526
+ handles: null,
527
+ kind: 'LinkedField',
528
+ loc: derivedFieldLocation,
529
+ metadata: null,
530
+ name: EDGES,
531
+ selections: [],
532
+ type: schema.assertLinkedFieldType(edgesType),
533
+ };
534
+ }
535
+ if (transformedPageInfoSelection == null) {
536
+ transformedPageInfoSelection = {
537
+ alias: PAGE_INFO,
538
+ args: [],
539
+ connection: false,
540
+ directives: [],
541
+ handles: null,
542
+ kind: 'LinkedField',
543
+ loc: derivedFieldLocation,
544
+ metadata: null,
545
+ name: PAGE_INFO,
546
+ selections: [],
547
+ type: schema.assertLinkedFieldType(pageInfoType),
548
+ };
549
+ }
550
+
551
+ // Generate (additional) fields on pageInfo and add to the transformed
552
+ // pageInfo field
553
+ const pageInfoRawType = schema.getRawType(pageInfoType);
554
+ let pageInfoText;
555
+ if (direction === 'forward') {
556
+ pageInfoText = `fragment PageInfo on ${schema.getTypeString(
557
+ pageInfoRawType,
558
+ )} {
559
+ ${END_CURSOR}
560
+ ${HAS_NEXT_PAGE}
561
+ }`;
562
+ } else if (direction === 'backward') {
563
+ pageInfoText = `fragment PageInfo on ${schema.getTypeString(
564
+ pageInfoRawType,
565
+ )} {
566
+ ${HAS_PREV_PAGE}
567
+ ${START_CURSOR}
568
+ }`;
569
+ } else {
570
+ pageInfoText = `fragment PageInfo on ${schema.getTypeString(
571
+ pageInfoRawType,
572
+ )} {
573
+ ${END_CURSOR}
574
+ ${HAS_NEXT_PAGE}
575
+ ${HAS_PREV_PAGE}
576
+ ${START_CURSOR}
577
+ }`;
578
+ }
579
+ const pageInfoAst = parse(pageInfoText);
580
+ const pageInfoFragment = RelayParser.transform(schema, [
581
+ pageInfoAst.definitions[0],
582
+ ])[0];
583
+ if (transformedPageInfoSelection.kind !== 'LinkedField') {
584
+ throw createCompilerError(
585
+ 'ConnectionTransform: Expected generated pageInfo selection to be ' +
586
+ 'a LinkedField',
587
+ [field.loc],
588
+ );
589
+ }
590
+ transformedPageInfoSelection = {
591
+ ...transformedPageInfoSelection,
592
+ selections: [
593
+ ...transformedPageInfoSelection.selections,
594
+ {
595
+ directives: [],
596
+ kind: 'InlineFragment',
597
+ loc: derivedFieldLocation,
598
+ metadata: null,
599
+ selections: pageInfoFragment.selections,
600
+ typeCondition: pageInfoFragment.type,
601
+ },
602
+ ],
603
+ };
604
+ // When streaming the pageInfo field has to be deferred
605
+ if (stream != null) {
606
+ transformedPageInfoSelection = {
607
+ if: stream.if?.value ?? null,
608
+ label: `${documentName}$defer$${stream.label}$${PAGE_INFO}`,
609
+ kind: 'Defer',
610
+ loc: derivedFieldLocation,
611
+ selections: [transformedPageInfoSelection],
612
+ };
613
+ }
614
+
615
+ // Generate additional fields on edges and append to the transformed edges
616
+ // selection
617
+ const edgeText = `
618
+ fragment Edges on ${schema.getTypeString(schema.getRawType(edgesType))} {
619
+ ${CURSOR}
620
+ ${NODE} {
621
+ __typename # rely on GenerateRequisiteFieldTransform to add "id"
622
+ }
623
+ }
624
+ `;
625
+ const edgeAst = parse(edgeText);
626
+ const edgeFragment = RelayParser.transform(schema, [
627
+ edgeAst.definitions[0],
628
+ ])[0];
629
+ // When streaming the edges field needs @stream
630
+ transformedEdgesSelection = {
631
+ ...transformedEdgesSelection,
632
+ directives:
633
+ streamDirective != null
634
+ ? [...transformedEdgesSelection.directives, streamDirective]
635
+ : transformedEdgesSelection.directives,
636
+ selections: [
637
+ ...transformedEdgesSelection.selections,
638
+ {
639
+ directives: [],
640
+ kind: 'InlineFragment',
641
+ loc: derivedFieldLocation,
642
+ metadata: null,
643
+ selections: edgeFragment.selections,
644
+ typeCondition: edgeFragment.type,
645
+ },
646
+ ],
647
+ };
648
+ // Copy the original selections, replacing edges/pageInfo (if present)
649
+ // with the generated locations. This is to maintain the original field
650
+ // ordering.
651
+ const selections = field.selections.map(selection => {
652
+ if (
653
+ transformedEdgesSelection != null &&
654
+ edgesSelection != null &&
655
+ selection === edgesSelection
656
+ ) {
657
+ return transformedEdgesSelection;
658
+ } else if (
659
+ transformedPageInfoSelection != null &&
660
+ pageInfoSelection != null &&
661
+ selection === pageInfoSelection
662
+ ) {
663
+ return transformedPageInfoSelection;
664
+ } else {
665
+ return selection;
666
+ }
667
+ });
668
+ // If edges/pageInfo were missing, append the generated versions instead.
669
+ if (edgesSelection == null && transformedEdgesSelection != null) {
670
+ selections.push(transformedEdgesSelection);
671
+ }
672
+ if (pageInfoSelection == null && transformedPageInfoSelection != null) {
673
+ selections.push(transformedPageInfoSelection);
674
+ }
675
+ return selections;
676
+ }
677
+
678
+ function findArg(field: LinkedField, argName: string): ?Argument {
679
+ return field.args && field.args.find(arg => arg.name === argName);
680
+ }
681
+
682
+ /**
683
+ * @internal
684
+ *
685
+ * Validates that the selection is a valid connection:
686
+ * - Specifies a first or last argument to prevent accidental, unconstrained
687
+ * data access.
688
+ * - Has an `edges` selection, otherwise there is nothing to paginate.
689
+ *
690
+ * TODO: This implementation requires the edges field to be a direct selection
691
+ * and not contained within an inline fragment or fragment spread. It's
692
+ * technically possible to remove this restriction if this pattern becomes
693
+ * common/necessary.
694
+ */
695
+ function validateConnectionSelection(field: LinkedField): void {
696
+ const {EDGES} = ConnectionInterface.get();
697
+
698
+ if (!findArg(field, FIRST) && !findArg(field, LAST)) {
699
+ throw createUserError(
700
+ `Expected field '${field.name}' to have a '${FIRST}' or '${LAST}' ` +
701
+ 'argument.',
702
+ [field.loc],
703
+ );
704
+ }
705
+ if (
706
+ !field.selections.some(
707
+ selection => selection.kind === 'LinkedField' && selection.name === EDGES,
708
+ )
709
+ ) {
710
+ throw createUserError(
711
+ `Expected field '${field.name}' to have an '${EDGES}' selection.`,
712
+ [field.loc],
713
+ );
714
+ }
715
+ }
716
+
717
+ /**
718
+ * @internal
719
+ *
720
+ * Validates that the type satisfies the Connection specification:
721
+ * - The type has an edges field, and edges have scalar `cursor` and object
722
+ * `node` fields.
723
+ * - The type has a page info field which is an object with the correct
724
+ * subfields.
725
+ */
726
+ function validateConnectionType(
727
+ schema: Schema,
728
+ field: LinkedField,
729
+ nullableType: CompositeTypeID,
730
+ connectionDirective: Directive,
731
+ ): void {
732
+ const directiveName = connectionDirective.name;
733
+ const {
734
+ CURSOR,
735
+ EDGES,
736
+ END_CURSOR,
737
+ HAS_NEXT_PAGE,
738
+ HAS_PREV_PAGE,
739
+ NODE,
740
+ PAGE_INFO,
741
+ START_CURSOR,
742
+ } = ConnectionInterface.get();
743
+
744
+ const typeName = schema.getTypeString(nullableType);
745
+ if (!schema.hasField(nullableType, EDGES)) {
746
+ throw createUserError(
747
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
748
+ `field type '${typeName}' to have an '${EDGES}' field`,
749
+ [field.loc],
750
+ );
751
+ }
752
+
753
+ const edges = schema.getFieldConfig(schema.expectField(nullableType, EDGES));
754
+
755
+ const edgesType = schema.getNullableType(edges.type);
756
+ if (!schema.isList(edgesType)) {
757
+ throw createUserError(
758
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
759
+ `field type '${typeName}' to have an '${EDGES}' field that returns ` +
760
+ 'a list of objects.',
761
+ [field.loc],
762
+ );
763
+ }
764
+ let edgeType = schema.getNullableType(schema.getListItemType(edgesType));
765
+ if (!schema.isObject(edgeType) && !schema.isInterface(edgeType)) {
766
+ throw createUserError(
767
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
768
+ `field type '${typeName}' to have an '${EDGES}' field that returns ` +
769
+ 'a list of objects.',
770
+ [field.loc],
771
+ );
772
+ }
773
+ edgeType = schema.assertCompositeType(edgeType);
774
+
775
+ if (!schema.hasField(edgeType, NODE)) {
776
+ throw createUserError(
777
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
778
+ `field type '${typeName}' to have an '${EDGES} { ${NODE} }' field ` +
779
+ 'that returns an object, interface, or union.',
780
+ [field.loc],
781
+ );
782
+ }
783
+ const node = schema.getFieldConfig(schema.expectField(edgeType, NODE));
784
+
785
+ const nodeType = schema.getNullableType(node.type);
786
+ if (!(schema.isAbstractType(nodeType) || schema.isObject(nodeType))) {
787
+ throw createUserError(
788
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
789
+ `field type '${typeName}' to have an '${EDGES} { ${NODE} }' field ` +
790
+ 'that returns an object, interface, or union.',
791
+ [field.loc],
792
+ );
793
+ }
794
+
795
+ if (!schema.hasField(edgeType, CURSOR)) {
796
+ throw createUserError(
797
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
798
+ `field type '${typeName}' to have an '${EDGES} { ${CURSOR} }' field ` +
799
+ 'that returns a scalar value.',
800
+ [field.loc],
801
+ );
802
+ }
803
+ const cursor = schema.getFieldConfig(schema.expectField(edgeType, CURSOR));
804
+
805
+ if (!schema.isScalar(schema.getNullableType(cursor.type))) {
806
+ throw createUserError(
807
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
808
+ `field type '${typeName}' to have an '${EDGES} { ${CURSOR} }' field ` +
809
+ 'that returns a scalar value.',
810
+ [field.loc],
811
+ );
812
+ }
813
+
814
+ if (!schema.hasField(nullableType, PAGE_INFO)) {
815
+ throw createUserError(
816
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
817
+ `field type '${typeName}' to have a '${PAGE_INFO}' field that returns ` +
818
+ 'an object.',
819
+ [field.loc],
820
+ );
821
+ }
822
+
823
+ const pageInfo = schema.getFieldConfig(
824
+ schema.expectField(nullableType, PAGE_INFO),
825
+ );
826
+
827
+ const pageInfoType = schema.getNullableType(pageInfo.type);
828
+ if (!schema.isObject(pageInfoType)) {
829
+ throw createUserError(
830
+ `@${directiveName} used on invalid field '${field.name}'. Expected the ` +
831
+ `field type '${typeName}' to have a '${PAGE_INFO}' field that ` +
832
+ 'returns an object.',
833
+ [field.loc],
834
+ );
835
+ }
836
+
837
+ [END_CURSOR, HAS_NEXT_PAGE, HAS_PREV_PAGE, START_CURSOR].forEach(
838
+ fieldName => {
839
+ const pageInfoField = schema.getFieldConfig(
840
+ schema.expectField(schema.assertObjectType(pageInfoType), fieldName),
841
+ );
842
+ if (!schema.isScalar(schema.getNullableType(pageInfoField.type))) {
843
+ throw createUserError(
844
+ `@${directiveName} used on invalid field '${field.name}'. Expected ` +
845
+ `the field type '${typeName}' to have a '${PAGE_INFO} { ${fieldName} }' ` +
846
+ 'field returns a scalar.',
847
+ [field.loc],
848
+ );
849
+ }
850
+ },
851
+ );
852
+ }
853
+
854
+ module.exports = {
855
+ buildConnectionMetadata,
856
+ CONNECTION,
857
+ SCHEMA_EXTENSION,
858
+ transform: connectionTransform,
859
+ };