relay-compiler 0.0.0-main-e0f88a3b → 0.0.0-main-2087b512
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/RelayCompilerBin.js.flow +2 -3
- package/bin/RelayCompilerMain.js.flow +12 -14
- package/bin/relay-compiler +5613 -5548
- package/codegen/CodegenDirectory.js.flow +4 -5
- package/codegen/CodegenRunner.js.flow +11 -13
- package/codegen/CodegenWatcher.js.flow +3 -4
- package/codegen/NormalizationCodeGenerator.js.flow +13 -14
- package/codegen/ReaderCodeGenerator.js.flow +14 -16
- package/codegen/RelayCodeGenerator.js.flow +7 -7
- package/codegen/RelayFileWriter.js.flow +20 -22
- package/codegen/compileRelayArtifacts.js.flow +5 -6
- package/codegen/writeRelayGeneratedFile.js.flow +7 -9
- package/core/ASTCache.js.flow +3 -4
- package/core/ASTConvert.js.flow +7 -8
- package/core/CompilerContext.js.flow +5 -7
- package/core/CompilerError.js.flow +2 -2
- package/core/DotGraphQLParser.js.flow +4 -6
- package/core/IR.js.flow +2 -2
- package/core/IRPrinter.js.flow +3 -4
- package/core/IRTransformer.js.flow +4 -5
- package/core/IRValidator.js.flow +3 -4
- package/core/IRVisitor.js.flow +2 -2
- package/core/JSModuleParser.js.flow +2 -2
- package/core/RelayCompilerScope.js.flow +2 -2
- package/core/RelayFindGraphQLTags.js.flow +6 -7
- package/core/RelayGraphQLEnumsGenerator.js.flow +2 -2
- package/core/RelayIRTransforms.js.flow +3 -3
- package/core/RelayParser.js.flow +16 -18
- package/core/RelaySourceModuleParser.js.flow +7 -9
- package/core/Schema.js.flow +24 -24
- package/core/SchemaUtils.js.flow +3 -3
- package/core/filterContextForNode.js.flow +2 -3
- package/core/getFieldDefinition.js.flow +3 -3
- package/core/getIdentifierForArgumentValue.js.flow +2 -2
- package/core/getIdentifierForSelection.js.flow +3 -4
- package/core/inferRootArgumentDefinitions.js.flow +5 -6
- package/index.js +1 -1
- package/index.js.flow +33 -35
- package/language/RelayLanguagePluginInterface.js.flow +3 -3
- package/language/javascript/FindGraphQLTags.js.flow +2 -3
- package/language/javascript/RelayFlowBabelFactories.js.flow +1 -1
- package/language/javascript/RelayFlowGenerator.js.flow +16 -19
- package/language/javascript/RelayFlowTypeTransformers.js.flow +3 -5
- package/language/javascript/RelayLanguagePluginJavaScript.js.flow +2 -3
- package/lib/bin/RelayCompilerBin.js +2 -2
- package/lib/bin/RelayCompilerMain.js +10 -10
- package/lib/codegen/CodegenDirectory.js +2 -3
- package/lib/codegen/CodegenRunner.js +9 -9
- package/lib/codegen/CodegenWatcher.js +2 -2
- package/lib/codegen/NormalizationCodeGenerator.js +11 -4
- package/lib/codegen/ReaderCodeGenerator.js +7 -6
- package/lib/codegen/RelayCodeGenerator.js +11 -4
- package/lib/codegen/RelayFileWriter.js +14 -14
- package/lib/codegen/compileRelayArtifacts.js +3 -3
- package/lib/codegen/writeRelayGeneratedFile.js +4 -4
- package/lib/core/CompilerContext.js +5 -5
- package/lib/core/CompilerError.js +2 -1
- package/lib/core/DotGraphQLParser.js +4 -4
- package/lib/core/IRPrinter.js +2 -2
- package/lib/core/IRTransformer.js +2 -2
- package/lib/core/IRValidator.js +2 -2
- package/lib/core/RelayCompilerScope.js +34 -0
- package/lib/core/RelayFindGraphQLTags.js +2 -2
- package/lib/core/RelayIRTransforms.js +4 -4
- package/lib/core/RelayParser.js +10 -10
- package/lib/core/RelaySourceModuleParser.js +5 -5
- package/lib/core/Schema.js +2 -2
- package/lib/core/filterContextForNode.js +2 -1
- package/lib/core/getIdentifierForArgumentValue.js +2 -1
- package/lib/core/getIdentifierForSelection.js +3 -2
- package/lib/core/inferRootArgumentDefinitions.js +3 -3
- package/lib/index.js +46 -46
- package/lib/language/RelayLanguagePluginInterface.js +13 -1
- package/lib/language/javascript/FindGraphQLTags.js +2 -2
- package/lib/language/javascript/RelayFlowBabelFactories.js +2 -2
- package/lib/language/javascript/RelayFlowGenerator.js +3 -3
- package/lib/language/javascript/RelayFlowTypeTransformers.js +2 -2
- package/lib/language/javascript/RelayLanguagePluginJavaScript.js +2 -2
- package/lib/runner/Artifacts.js +3 -3
- package/lib/runner/BufferedFilesystem.js +2 -1
- package/lib/runner/GraphQLASTNodeGroup.js +2 -2
- package/lib/runner/GraphQLNodeMap.js +2 -2
- package/lib/runner/Sources.js +2 -2
- package/lib/runner/compileArtifacts.js +2 -2
- package/lib/runner/extractAST.js +2 -2
- package/lib/transforms/ApplyFragmentArgumentTransform.js +6 -6
- package/lib/transforms/ClientExtensionsTransform.js +2 -2
- package/lib/transforms/ConnectionTransform.js +6 -6
- package/lib/transforms/DeclarativeConnectionMutationTransform.js +2 -2
- package/lib/transforms/DeferStreamTransform.js +4 -4
- package/lib/transforms/DisallowIdAsAlias.js +2 -2
- package/lib/transforms/DisallowTypenameOnRoot.js +2 -2
- package/lib/transforms/FilterDirectivesTransform.js +2 -1
- package/lib/transforms/FlattenTransform.js +6 -6
- package/lib/transforms/InlineDataFragmentTransform.js +2 -2
- package/lib/transforms/MaskTransform.js +4 -4
- package/lib/transforms/MatchTransform.js +4 -4
- package/lib/transforms/ReactFlightComponentTransform.js +4 -4
- package/lib/transforms/RefetchableFragmentTransform.js +4 -4
- package/lib/transforms/RelayDirectiveTransform.js +2 -2
- package/lib/transforms/RequiredFieldTransform.js +4 -4
- package/lib/transforms/SkipHandleFieldTransform.js +2 -1
- package/lib/transforms/SkipRedundantNodesTransform.js +11 -3
- package/lib/transforms/SkipUnusedVariablesTransform.js +2 -1
- package/lib/transforms/SplitModuleImportTransform.js +2 -2
- package/lib/transforms/TestOperationTransform.js +3 -3
- package/lib/transforms/ValidateGlobalVariablesTransform.js +3 -2
- package/lib/transforms/ValidateRequiredArgumentsTransform.js +2 -2
- package/lib/transforms/ValidateServerOnlyDirectivesTransform.js +2 -2
- package/lib/transforms/ValidateUnusedVariablesTransform.js +2 -2
- package/lib/transforms/query-generators/FetchableQueryGenerator.js +2 -2
- package/lib/transforms/query-generators/NodeQueryGenerator.js +4 -4
- package/lib/transforms/query-generators/index.js +3 -3
- package/lib/util/joinArgumentDefinitions.js +2 -1
- package/package.json +2 -2
- package/relay-compiler.js +4 -4
- package/relay-compiler.min.js +4 -4
- package/reporters/ConsoleReporter.js.flow +2 -2
- package/runner/Artifacts.js.flow +4 -5
- package/runner/BufferedFilesystem.js.flow +3 -3
- package/runner/GraphQLASTNodeGroup.js.flow +2 -3
- package/runner/GraphQLNodeMap.js.flow +3 -3
- package/runner/Sources.js.flow +5 -6
- package/runner/compileArtifacts.js.flow +5 -6
- package/runner/extractAST.js.flow +4 -6
- package/runner/getChangedNodeNames.js.flow +2 -2
- package/runner/getSchemaInstance.js.flow +3 -3
- package/transforms/ApplyFragmentArgumentTransform.js.flow +9 -11
- package/transforms/ClientExtensionsTransform.js.flow +3 -4
- package/transforms/ConnectionTransform.js.flow +11 -13
- package/transforms/DeclarativeConnectionMutationTransform.js.flow +3 -5
- package/transforms/DeferStreamTransform.js.flow +5 -7
- package/transforms/DisallowIdAsAlias.js.flow +3 -4
- package/transforms/DisallowTypenameOnRoot.js.flow +3 -4
- package/transforms/FieldHandleTransform.js.flow +3 -5
- package/transforms/FilterCompilerDirectivesTransform.js.flow +2 -2
- package/transforms/FilterDirectivesTransform.js.flow +2 -2
- package/transforms/FlattenTransform.js.flow +5 -7
- package/transforms/GenerateIDFieldTransform.js.flow +4 -5
- package/transforms/GenerateTypeNameTransform.js.flow +4 -6
- package/transforms/InlineDataFragmentTransform.js.flow +3 -4
- package/transforms/InlineFragmentsTransform.js.flow +3 -4
- package/transforms/MaskTransform.js.flow +6 -8
- package/transforms/MatchTransform.js.flow +7 -9
- package/transforms/ReactFlightComponentTransform.js.flow +5 -6
- package/transforms/RefetchableFragmentTransform.js.flow +7 -9
- package/transforms/RelayDirectiveTransform.js.flow +3 -4
- package/transforms/RequiredFieldTransform.js.flow +10 -12
- package/transforms/SkipClientExtensionsTransform.js.flow +2 -2
- package/transforms/SkipHandleFieldTransform.js.flow +2 -2
- package/transforms/SkipRedundantNodesTransform.js.flow +6 -8
- package/transforms/SkipSplitOperationTransform.js.flow +2 -2
- package/transforms/SkipUnreachableNodeTransform.js.flow +3 -4
- package/transforms/SkipUnusedVariablesTransform.js.flow +2 -2
- package/transforms/SplitModuleImportTransform.js.flow +4 -5
- package/transforms/TestOperationTransform.js.flow +2 -2
- package/transforms/ValidateGlobalVariablesTransform.js.flow +3 -4
- package/transforms/ValidateRequiredArgumentsTransform.js.flow +5 -6
- package/transforms/ValidateServerOnlyDirectivesTransform.js.flow +3 -4
- package/transforms/ValidateUnusedVariablesTransform.js.flow +3 -4
- package/transforms/query-generators/FetchableQueryGenerator.js.flow +4 -5
- package/transforms/query-generators/NodeQueryGenerator.js.flow +5 -7
- package/transforms/query-generators/QueryQueryGenerator.js.flow +4 -4
- package/transforms/query-generators/ViewerQueryGenerator.js.flow +4 -4
- package/transforms/query-generators/index.js.flow +4 -5
- package/util/RelayCompilerCache.js.flow +0 -1
- package/util/TimeReporter.js.flow +2 -2
- package/util/argumentContainsVariables.js.flow +1 -1
- package/util/generateAbstractTypeRefinementKey.js.flow +2 -2
- package/util/getDefinitionNodeHash.js.flow +2 -3
- package/util/joinArgumentDefinitions.js.flow +2 -2
package/lib/index.js
CHANGED
@@ -10,39 +10,48 @@
|
|
10
10
|
// flowlint ambiguous-object-type:error
|
11
11
|
'use strict';
|
12
12
|
|
13
|
-
var
|
13
|
+
var _require = require('./bin/RelayCompilerMain'),
|
14
|
+
main = _require.main;
|
14
15
|
|
15
|
-
var
|
16
|
+
var CodegenDirectory = require('./codegen/CodegenDirectory');
|
16
17
|
|
17
|
-
var
|
18
|
+
var CodegenRunner = require('./codegen/CodegenRunner');
|
18
19
|
|
19
|
-
var
|
20
|
+
var CodegenWatcher = require('./codegen/CodegenWatcher');
|
20
21
|
|
21
|
-
var
|
22
|
+
var compileRelayArtifacts = require('./codegen/compileRelayArtifacts');
|
22
23
|
|
23
|
-
var
|
24
|
+
var RelayCodeGenerator = require('./codegen/RelayCodeGenerator');
|
24
25
|
|
25
|
-
var
|
26
|
+
var RelayFileWriter = require('./codegen/RelayFileWriter');
|
26
27
|
|
27
|
-
var
|
28
|
+
var _require2 = require('./codegen/SourceControl'),
|
29
|
+
SourceControlMercurial = _require2.SourceControlMercurial;
|
30
|
+
|
31
|
+
var writeRelayGeneratedFile = require('./codegen/writeRelayGeneratedFile');
|
32
|
+
|
33
|
+
var ASTCache = require('./core/ASTCache');
|
34
|
+
|
35
|
+
var ASTConvert = require('./core/ASTConvert');
|
28
36
|
|
29
37
|
var CompilerContext = require('./core/CompilerContext');
|
30
38
|
|
31
39
|
var CompilerError = require('./core/CompilerError');
|
32
40
|
|
33
|
-
var ConsoleReporter = require('./reporters/ConsoleReporter');
|
34
|
-
|
35
41
|
var DotGraphQLParser = require('./core/DotGraphQLParser');
|
36
42
|
|
37
|
-
var
|
43
|
+
var filterContextForNode = require('./core/filterContextForNode');
|
38
44
|
|
39
|
-
var
|
45
|
+
var getIdentifierForArgumentValue = require('./core/getIdentifierForArgumentValue');
|
40
46
|
|
41
|
-
var
|
47
|
+
var getLiteralArgumentValues = require('./core/getLiteralArgumentValues');
|
48
|
+
|
49
|
+
var getNormalizationOperationName = require('./core/getNormalizationOperationName');
|
42
50
|
|
43
51
|
var GraphQLCompilerProfiler = require('./core/GraphQLCompilerProfiler');
|
44
52
|
|
45
|
-
var
|
53
|
+
var _require3 = require('./core/GraphQLDerivedFromMetadata'),
|
54
|
+
getReaderSourceDefinitionName = _require3.getReaderSourceDefinitionName;
|
46
55
|
|
47
56
|
var GraphQLWatchmanClient = require('./core/GraphQLWatchmanClient');
|
48
57
|
|
@@ -54,67 +63,58 @@ var IRVisitor = require('./core/IRVisitor');
|
|
54
63
|
|
55
64
|
var JSModuleParser = require('./core/JSModuleParser');
|
56
65
|
|
57
|
-
var MultiReporter = require('./reporters/MultiReporter');
|
58
|
-
|
59
|
-
var RelayCodeGenerator = require('./codegen/RelayCodeGenerator');
|
60
|
-
|
61
|
-
var RelayFileWriter = require('./codegen/RelayFileWriter');
|
62
|
-
|
63
66
|
var RelayFindGraphQLTags = require('./core/RelayFindGraphQLTags');
|
64
67
|
|
65
|
-
var RelayFlowGenerator = require('./language/javascript/RelayFlowGenerator');
|
66
|
-
|
67
68
|
var RelayIRTransforms = require('./core/RelayIRTransforms');
|
68
69
|
|
69
70
|
var RelayParser = require('./core/RelayParser');
|
70
71
|
|
71
72
|
var RelaySchema = require('./core/Schema');
|
72
73
|
|
73
|
-
var Rollout = require('./util/Rollout');
|
74
|
-
|
75
74
|
var SchemaUtils = require('./core/SchemaUtils');
|
76
75
|
|
77
|
-
var
|
76
|
+
var FindGraphQLTags = require('./language/javascript/FindGraphQLTags');
|
78
77
|
|
79
|
-
var
|
78
|
+
var _require4 = require('./language/javascript/formatGeneratedModule'),
|
79
|
+
formatGeneratedModule = _require4.formatGeneratedCommonjsModule;
|
80
80
|
|
81
|
-
var
|
81
|
+
var RelayFlowGenerator = require('./language/javascript/RelayFlowGenerator');
|
82
82
|
|
83
|
-
var
|
83
|
+
var ConsoleReporter = require('./reporters/ConsoleReporter');
|
84
84
|
|
85
|
-
var
|
85
|
+
var MultiReporter = require('./reporters/MultiReporter');
|
86
86
|
|
87
|
-
var
|
87
|
+
var Artifacts = require('./runner/Artifacts');
|
88
88
|
|
89
|
-
var
|
89
|
+
var BufferedFilesystem = require('./runner/BufferedFilesystem');
|
90
|
+
|
91
|
+
var compileArtifacts = require('./runner/compileArtifacts');
|
92
|
+
|
93
|
+
var extractAST = require('./runner/extractAST');
|
90
94
|
|
91
95
|
var getChangedNodeNames = require('./runner/getChangedNodeNames');
|
92
96
|
|
93
|
-
var
|
97
|
+
var getSchemaInstance = require('./runner/getSchemaInstance');
|
94
98
|
|
95
|
-
var
|
99
|
+
var GraphQLASTNodeGroup = require('./runner/GraphQLASTNodeGroup');
|
96
100
|
|
97
|
-
var
|
101
|
+
var GraphQLASTUtils = require('./runner/GraphQLASTUtils');
|
98
102
|
|
99
|
-
var
|
103
|
+
var GraphQLNodeMap = require('./runner/GraphQLNodeMap');
|
100
104
|
|
101
|
-
var
|
105
|
+
var Sources = require('./runner/Sources');
|
102
106
|
|
103
|
-
var
|
107
|
+
var StrictMap = require('./runner/StrictMap');
|
104
108
|
|
105
|
-
var
|
109
|
+
var CodeMarker = require('./util/CodeMarker');
|
106
110
|
|
107
|
-
var
|
108
|
-
main = _require.main;
|
111
|
+
var getDefinitionNodeHash = require('./util/getDefinitionNodeHash');
|
109
112
|
|
110
|
-
var
|
111
|
-
SourceControlMercurial = _require2.SourceControlMercurial;
|
113
|
+
var md5 = require('./util/md5');
|
112
114
|
|
113
|
-
var
|
114
|
-
getReaderSourceDefinitionName = _require3.getReaderSourceDefinitionName;
|
115
|
+
var Rollout = require('./util/Rollout');
|
115
116
|
|
116
|
-
var
|
117
|
-
formatGeneratedModule = _require4.formatGeneratedCommonjsModule;
|
117
|
+
var TimeReporter = require('./util/TimeReporter');
|
118
118
|
|
119
119
|
module.exports = {
|
120
120
|
relayCompiler: main,
|
@@ -11,4 +11,16 @@
|
|
11
11
|
'use strict';
|
12
12
|
|
13
13
|
var _require = require('relay-runtime'),
|
14
|
-
RelayConcreteNode = _require.RelayConcreteNode;
|
14
|
+
RelayConcreteNode = _require.RelayConcreteNode;
|
15
|
+
/**
|
16
|
+
* A language plugin allows relay-compiler to both read and write files for any
|
17
|
+
* language.
|
18
|
+
*
|
19
|
+
* When reading, the plugin is expected to parse and return GraphQL tags; and
|
20
|
+
* when writing the plugin is responsible for generating type information about
|
21
|
+
* the GraphQL selections made as well as generating the contents of the
|
22
|
+
* artifact file.
|
23
|
+
*
|
24
|
+
* This interface describes the details relay-compiler requires to be able to
|
25
|
+
* use the plugin and is expected to be returned by a {PluginInitializer}.
|
26
|
+
*/
|
@@ -14,9 +14,9 @@ var Profiler = require('../../core/GraphQLCompilerProfiler');
|
|
14
14
|
|
15
15
|
var babylon = require('@babel/parser');
|
16
16
|
|
17
|
-
var util = require('util');
|
17
|
+
var util = require('util'); // Attempt to be as inclusive as possible of source text.
|
18
|
+
|
18
19
|
|
19
|
-
// Attempt to be as inclusive as possible of source text.
|
20
20
|
var BABYLON_OPTIONS = {
|
21
21
|
allowImportExportEverywhere: true,
|
22
22
|
allowReturnOutsideFunction: true,
|
@@ -18,16 +18,16 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
18
18
|
|
19
19
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
20
20
|
|
21
|
-
var
|
21
|
+
var Profiler = require('../../core/GraphQLCompilerProfiler');
|
22
22
|
|
23
23
|
var IRVisitor = require('../../core/IRVisitor');
|
24
24
|
|
25
|
+
var FlattenTransform = require('../../transforms/FlattenTransform');
|
26
|
+
|
25
27
|
var MaskTransform = require('../../transforms/MaskTransform');
|
26
28
|
|
27
29
|
var MatchTransform = require('../../transforms/MatchTransform');
|
28
30
|
|
29
|
-
var Profiler = require('../../core/GraphQLCompilerProfiler');
|
30
|
-
|
31
31
|
var RefetchableFragmentTransform = require('../../transforms/RefetchableFragmentTransform');
|
32
32
|
|
33
33
|
var RelayDirectiveTransform = require('../../transforms/RelayDirectiveTransform');
|
@@ -10,12 +10,12 @@
|
|
10
10
|
// flowlint ambiguous-object-type:error
|
11
11
|
'use strict';
|
12
12
|
|
13
|
-
var t = require('@babel/types');
|
14
|
-
|
15
13
|
var _require = require('./RelayFlowBabelFactories'),
|
16
14
|
exactObjectTypeAnnotation = _require.exactObjectTypeAnnotation,
|
17
15
|
readOnlyArrayOfType = _require.readOnlyArrayOfType;
|
18
16
|
|
17
|
+
var t = require('@babel/types');
|
18
|
+
|
19
19
|
function getInputObjectTypeIdentifier(schema, typeID) {
|
20
20
|
return schema.getTypeString(typeID);
|
21
21
|
}
|
@@ -10,8 +10,6 @@
|
|
10
10
|
// flowlint ambiguous-object-type:error
|
11
11
|
'use strict';
|
12
12
|
|
13
|
-
var RelayFlowGenerator = require('./RelayFlowGenerator');
|
14
|
-
|
15
13
|
var _require = require('./FindGraphQLTags'),
|
16
14
|
find = _require.find;
|
17
15
|
|
@@ -19,6 +17,8 @@ var _require2 = require('./formatGeneratedModule'),
|
|
19
17
|
formatGeneratedCommonjsModule = _require2.formatGeneratedCommonjsModule,
|
20
18
|
formatGeneratedESModule = _require2.formatGeneratedESModule;
|
21
19
|
|
20
|
+
var RelayFlowGenerator = require('./RelayFlowGenerator');
|
21
|
+
|
22
22
|
module.exports = function (options) {
|
23
23
|
return {
|
24
24
|
inputExtensions: ['js', 'jsx'],
|
package/lib/runner/Artifacts.js
CHANGED
@@ -16,13 +16,13 @@ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime
|
|
16
16
|
|
17
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
18
18
|
|
19
|
+
var _require = require('./GraphQLASTUtils'),
|
20
|
+
getName = _require.getName;
|
21
|
+
|
19
22
|
var crypto = require('crypto');
|
20
23
|
|
21
24
|
var nullthrows = require('nullthrows');
|
22
25
|
|
23
|
-
var _require = require('./GraphQLASTUtils'),
|
24
|
-
getName = _require.getName;
|
25
|
-
|
26
26
|
function createEmptyState() {
|
27
27
|
return {
|
28
28
|
artifacts: new Map(),
|
@@ -22,11 +22,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
22
22
|
var fs = require('fs');
|
23
23
|
|
24
24
|
var invariant = require('invariant');
|
25
|
-
|
26
25
|
/**
|
27
26
|
* A filesystem wrapper that buffers file reads and writes until `commit()` is
|
28
27
|
* called.
|
29
28
|
*/
|
29
|
+
|
30
|
+
|
30
31
|
var BufferedFilesystem = /*#__PURE__*/function () {
|
31
32
|
function BufferedFilesystem() {
|
32
33
|
(0, _defineProperty2["default"])(this, "buffer", new Map());
|
@@ -16,11 +16,11 @@ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime
|
|
16
16
|
|
17
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
18
18
|
|
19
|
-
var GraphQLNodeMap = require('./GraphQLNodeMap');
|
20
|
-
|
21
19
|
var _require = require('./GraphQLASTUtils'),
|
22
20
|
getName = _require.getName;
|
23
21
|
|
22
|
+
var GraphQLNodeMap = require('./GraphQLNodeMap');
|
23
|
+
|
24
24
|
var _require2 = require('graphql'),
|
25
25
|
visit = _require2.visit;
|
26
26
|
|
@@ -19,8 +19,8 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inh
|
|
19
19
|
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
20
20
|
|
21
21
|
var _require = require('../core/CompilerError'),
|
22
|
-
|
23
|
-
|
22
|
+
createCompilerError = _require.createCompilerError,
|
23
|
+
createUserError = _require.createUserError;
|
24
24
|
|
25
25
|
var _require2 = require('./GraphQLASTUtils'),
|
26
26
|
getName = _require2.getName;
|
package/lib/runner/Sources.js
CHANGED
@@ -17,8 +17,6 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
17
17
|
|
18
18
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
19
19
|
|
20
|
-
var invariant = require('invariant');
|
21
|
-
|
22
20
|
var md5 = require('../util/md5');
|
23
21
|
|
24
22
|
var _require = require('./extractAST'),
|
@@ -28,6 +26,8 @@ var _require2 = require('graphql'),
|
|
28
26
|
Source = _require2.Source,
|
29
27
|
parse = _require2.parse;
|
30
28
|
|
29
|
+
var invariant = require('invariant');
|
30
|
+
|
31
31
|
var Sources = /*#__PURE__*/function () {
|
32
32
|
Sources.fromSavedState = function fromSavedState(_ref) {
|
33
33
|
var extractFromFile = _ref.extractFromFile,
|
@@ -10,14 +10,14 @@
|
|
10
10
|
// flowlint ambiguous-object-type:error
|
11
11
|
'use strict';
|
12
12
|
|
13
|
+
var compileRelayArtifacts = require('../codegen/compileRelayArtifacts');
|
14
|
+
|
13
15
|
var ASTConvert = require('../core/ASTConvert');
|
14
16
|
|
15
17
|
var CompilerContext = require('../core/CompilerContext');
|
16
18
|
|
17
19
|
var RelayParser = require('../core/RelayParser');
|
18
20
|
|
19
|
-
var compileRelayArtifacts = require('../codegen/compileRelayArtifacts');
|
20
|
-
|
21
21
|
function compileArtifacts(_ref) {
|
22
22
|
var schema = _ref.schema,
|
23
23
|
compilerTransforms = _ref.compilerTransforms,
|
package/lib/runner/extractAST.js
CHANGED
@@ -12,12 +12,12 @@
|
|
12
12
|
|
13
13
|
var JSModuleParser = require('../core/JSModuleParser');
|
14
14
|
|
15
|
-
var invariant = require('invariant');
|
16
|
-
|
17
15
|
var _require = require('graphql'),
|
18
16
|
parse = _require.parse,
|
19
17
|
print = _require.print;
|
20
18
|
|
19
|
+
var invariant = require('invariant');
|
20
|
+
|
21
21
|
function extractFromJS(baseDir, file) {
|
22
22
|
if (!file.exists) {
|
23
23
|
return null;
|
@@ -18,18 +18,18 @@ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime
|
|
18
18
|
|
19
19
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
20
20
|
|
21
|
+
var _require = require('../core/CompilerError'),
|
22
|
+
createCompilerError = _require.createCompilerError,
|
23
|
+
createNonRecoverableUserError = _require.createNonRecoverableUserError;
|
24
|
+
|
25
|
+
var getIdentifierForArgumentValue = require('../core/getIdentifierForArgumentValue');
|
26
|
+
|
21
27
|
var IRTransformer = require('../core/IRTransformer');
|
22
28
|
|
23
29
|
var RelayCompilerScope = require('../core/RelayCompilerScope');
|
24
30
|
|
25
|
-
var getIdentifierForArgumentValue = require('../core/getIdentifierForArgumentValue');
|
26
|
-
|
27
31
|
var murmurHash = require('../util/murmurHash');
|
28
32
|
|
29
|
-
var _require = require('../core/CompilerError'),
|
30
|
-
createCompilerError = _require.createCompilerError,
|
31
|
-
createNonRecoverableUserError = _require.createNonRecoverableUserError;
|
32
|
-
|
33
33
|
var getFragmentScope = RelayCompilerScope.getFragmentScope,
|
34
34
|
getRootScope = RelayCompilerScope.getRootScope;
|
35
35
|
|
@@ -16,12 +16,12 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
16
16
|
|
17
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
18
18
|
|
19
|
-
var IRTransformer = require('../core/IRTransformer');
|
20
|
-
|
21
19
|
var _require = require('../core/CompilerError'),
|
22
20
|
createCompilerError = _require.createCompilerError,
|
23
21
|
createUserError = _require.createUserError;
|
24
22
|
|
23
|
+
var IRTransformer = require('../core/IRTransformer');
|
24
|
+
|
25
25
|
var cachesByNode = new Map();
|
26
26
|
|
27
27
|
function clientExtensionTransform(context) {
|
@@ -16,18 +16,18 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
16
16
|
|
17
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
18
18
|
|
19
|
+
var _require = require('../core/CompilerError'),
|
20
|
+
createCompilerError = _require.createCompilerError,
|
21
|
+
createUserError = _require.createUserError;
|
22
|
+
|
23
|
+
var getLiteralArgumentValues = require('../core/getLiteralArgumentValues');
|
24
|
+
|
19
25
|
var IRTransformer = require('../core/IRTransformer');
|
20
26
|
|
21
27
|
var RelayParser = require('../core/RelayParser');
|
22
28
|
|
23
29
|
var SchemaUtils = require('../core/SchemaUtils');
|
24
30
|
|
25
|
-
var getLiteralArgumentValues = require('../core/getLiteralArgumentValues');
|
26
|
-
|
27
|
-
var _require = require('../core/CompilerError'),
|
28
|
-
createCompilerError = _require.createCompilerError,
|
29
|
-
createUserError = _require.createUserError;
|
30
|
-
|
31
31
|
var _require2 = require('graphql'),
|
32
32
|
parse = _require2.parse;
|
33
33
|
|
@@ -18,11 +18,11 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
18
18
|
|
19
19
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
20
20
|
|
21
|
-
var IRTransformer = require('../core/IRTransformer');
|
22
|
-
|
23
21
|
var _require = require('../core/CompilerError'),
|
24
22
|
createUserError = _require.createUserError;
|
25
23
|
|
24
|
+
var IRTransformer = require('../core/IRTransformer');
|
25
|
+
|
26
26
|
var _require2 = require('relay-runtime'),
|
27
27
|
ConnectionInterface = _require2.ConnectionInterface;
|
28
28
|
|
@@ -16,14 +16,14 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
16
16
|
|
17
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
18
18
|
|
19
|
-
var
|
19
|
+
var _require = require('../core/CompilerError'),
|
20
|
+
createUserError = _require.createUserError;
|
20
21
|
|
21
22
|
var getIdentifierForArgumentValue = require('../core/getIdentifierForArgumentValue');
|
22
23
|
|
23
|
-
var
|
24
|
+
var IRTransformer = require('../core/IRTransformer');
|
24
25
|
|
25
|
-
var
|
26
|
-
createUserError = _require.createUserError;
|
26
|
+
var murmurHash = require('../util/murmurHash');
|
27
27
|
|
28
28
|
/**
|
29
29
|
* This transform finds usages of @defer and @stream, validates them, and
|
@@ -10,11 +10,11 @@
|
|
10
10
|
// flowlint ambiguous-object-type:error
|
11
11
|
'use strict';
|
12
12
|
|
13
|
-
var IRTransformer = require('../core/IRTransformer');
|
14
|
-
|
15
13
|
var _require = require('../core/CompilerError'),
|
16
14
|
createUserError = _require.createUserError;
|
17
15
|
|
16
|
+
var IRTransformer = require('../core/IRTransformer');
|
17
|
+
|
18
18
|
function visitField(field) {
|
19
19
|
if (field.alias === 'id' && field.name !== 'id') {
|
20
20
|
throw createUserError('Relay does not allow aliasing fields to `id`. ' + 'This name is reserved for the globally unique `id` field on ' + '`Node`.', [field.loc]);
|
@@ -14,11 +14,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
14
14
|
|
15
15
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
16
16
|
|
17
|
-
var IRValidator = require('../core/IRValidator');
|
18
|
-
|
19
17
|
var _require = require('../core/CompilerError'),
|
20
18
|
createUserError = _require.createUserError;
|
21
19
|
|
20
|
+
var IRValidator = require('../core/IRValidator');
|
21
|
+
|
22
22
|
function visitRoot(node) {
|
23
23
|
var _iterator = (0, _createForOfIteratorHelper2["default"])(node.selections),
|
24
24
|
_step;
|
@@ -11,11 +11,12 @@
|
|
11
11
|
'use strict';
|
12
12
|
|
13
13
|
var IRTransformer = require('../core/IRTransformer');
|
14
|
-
|
15
14
|
/**
|
16
15
|
* A transform that removes any directives that were not present in the
|
17
16
|
* server schema.
|
18
17
|
*/
|
18
|
+
|
19
|
+
|
19
20
|
function filterDirectivesTransform(context) {
|
20
21
|
var schemaDirectives = new Set(context.getSchema().getDirectives().filter(function (directive) {
|
21
22
|
return !directive.isClient;
|
@@ -14,16 +14,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
14
14
|
|
15
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
16
|
|
17
|
-
var IRTransformer = require('../core/IRTransformer');
|
18
|
-
|
19
|
-
var areEqualArgValues = require('../util/areEqualArgValues');
|
20
|
-
|
21
|
-
var getIdentifierForSelection = require('../core/getIdentifierForSelection');
|
22
|
-
|
23
17
|
var _require = require('../core/CompilerError'),
|
24
18
|
createCompilerError = _require.createCompilerError,
|
25
19
|
createUserError = _require.createUserError;
|
26
20
|
|
21
|
+
var getIdentifierForSelection = require('../core/getIdentifierForSelection');
|
22
|
+
|
23
|
+
var IRTransformer = require('../core/IRTransformer');
|
24
|
+
|
25
|
+
var areEqualArgValues = require('../util/areEqualArgValues');
|
26
|
+
|
27
27
|
/**
|
28
28
|
* Transform that flattens inline fragments, fragment spreads, and conditionals.
|
29
29
|
*
|
@@ -14,11 +14,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
14
14
|
|
15
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
16
|
|
17
|
-
var IRTransformer = require('../core/IRTransformer');
|
18
|
-
|
19
17
|
var _require = require('../core/CompilerError'),
|
20
18
|
createUserError = _require.createUserError;
|
21
19
|
|
20
|
+
var IRTransformer = require('../core/IRTransformer');
|
21
|
+
|
22
22
|
var SCHEMA_EXTENSION = "\ndirective @inline on FRAGMENT_DEFINITION\n";
|
23
23
|
/**
|
24
24
|
* A transform that converts fragment spreads where the referenced fragment
|
@@ -16,14 +16,14 @@ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime
|
|
16
16
|
|
17
17
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
18
18
|
|
19
|
-
var
|
19
|
+
var _require = require('../core/CompilerError'),
|
20
|
+
createUserError = _require.createUserError;
|
20
21
|
|
21
|
-
var
|
22
|
+
var IRTransformer = require('../core/IRTransformer');
|
22
23
|
|
23
24
|
var joinArgumentDefinitions = require('../util/joinArgumentDefinitions');
|
24
25
|
|
25
|
-
var
|
26
|
-
createUserError = _require.createUserError;
|
26
|
+
var invariant = require('invariant');
|
27
27
|
|
28
28
|
/**
|
29
29
|
* A transform that inlines fragment spreads with the @relay(mask: false)
|
@@ -16,15 +16,15 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
16
16
|
|
17
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
18
18
|
|
19
|
-
var
|
19
|
+
var _require = require('../core/CompilerError'),
|
20
|
+
createCompilerError = _require.createCompilerError,
|
21
|
+
createUserError = _require.createUserError;
|
20
22
|
|
21
23
|
var getLiteralArgumentValues = require('../core/getLiteralArgumentValues');
|
22
24
|
|
23
25
|
var getNormalizationOperationName = require('../core/getNormalizationOperationName');
|
24
26
|
|
25
|
-
var
|
26
|
-
createCompilerError = _require.createCompilerError,
|
27
|
-
createUserError = _require.createUserError;
|
27
|
+
var IRTransformer = require('../core/IRTransformer');
|
28
28
|
|
29
29
|
var _require2 = require('relay-runtime'),
|
30
30
|
getModuleComponentKey = _require2.getModuleComponentKey,
|
@@ -14,11 +14,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
14
14
|
|
15
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
16
|
|
17
|
-
var IRTransformer = require('../core/IRTransformer');
|
18
|
-
|
19
17
|
var _require = require('../core/CompilerError'),
|
20
|
-
|
21
|
-
|
18
|
+
createCompilerError = _require.createCompilerError,
|
19
|
+
createUserError = _require.createUserError;
|
20
|
+
|
21
|
+
var IRTransformer = require('../core/IRTransformer');
|
22
22
|
|
23
23
|
var _require2 = require('relay-runtime'),
|
24
24
|
RelayFeatureFlags = _require2.RelayFeatureFlags;
|
@@ -14,15 +14,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
14
14
|
|
15
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
16
|
|
17
|
-
var
|
17
|
+
var _require = require('../core/CompilerError'),
|
18
|
+
createUserError = _require.createUserError,
|
19
|
+
eachWithCombinedError = _require.eachWithCombinedError;
|
18
20
|
|
19
21
|
var getLiteralArgumentValues = require('../core/getLiteralArgumentValues');
|
20
22
|
|
21
23
|
var inferRootArgumentDefinitions = require('../core/inferRootArgumentDefinitions');
|
22
24
|
|
23
|
-
var
|
24
|
-
createUserError = _require.createUserError,
|
25
|
-
eachWithCombinedError = _require.eachWithCombinedError;
|
25
|
+
var IRVisitor = require('../core/IRVisitor');
|
26
26
|
|
27
27
|
var _require2 = require('./query-generators'),
|
28
28
|
buildRefetchOperation = _require2.buildRefetchOperation;
|