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
@@ -12,14 +12,13 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
import type CompilerContext from '../core/CompilerContext';
|
16
|
+
import type {Fragment, FragmentSpread} from '../core/IR';
|
16
17
|
|
17
18
|
const getLiteralArgumentValues = require('../core/getLiteralArgumentValues');
|
19
|
+
const IRTransformer = require('../core/IRTransformer');
|
18
20
|
const invariant = require('invariant');
|
19
21
|
|
20
|
-
import type CompilerContext from '../core/CompilerContext';
|
21
|
-
import type {Fragment, FragmentSpread} from '../core/IR';
|
22
|
-
|
23
22
|
const RELAY = 'relay';
|
24
23
|
const SCHEMA_EXTENSION = `
|
25
24
|
directive @relay(
|
@@ -12,27 +12,25 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRTransformer = require('../core/IRTransformer');
|
16
|
-
|
17
|
-
const partitionArray = require('../util/partitionArray');
|
18
|
-
|
19
|
-
const {createUserError, createCompilerError} = require('../core/CompilerError');
|
20
|
-
const {RelayFeatureFlags} = require('relay-runtime');
|
21
|
-
|
22
15
|
import type CompilerContext from '../core/CompilerContext';
|
23
16
|
import type {
|
24
|
-
LinkedField,
|
25
|
-
ScalarField,
|
26
17
|
Field,
|
27
|
-
Location,
|
28
|
-
InlineFragment,
|
29
18
|
Fragment,
|
30
|
-
|
19
|
+
InlineFragment,
|
20
|
+
LinkedField,
|
21
|
+
Location,
|
31
22
|
Metadata,
|
23
|
+
Root,
|
24
|
+
ScalarField,
|
32
25
|
} from '../core/IR';
|
33
26
|
import type {Schema} from '../core/Schema';
|
34
27
|
import type {RequiredFieldAction} from 'relay-runtime';
|
35
28
|
|
29
|
+
const {createCompilerError, createUserError} = require('../core/CompilerError');
|
30
|
+
const IRTransformer = require('../core/IRTransformer');
|
31
|
+
const partitionArray = require('../util/partitionArray');
|
32
|
+
const {RelayFeatureFlags} = require('relay-runtime');
|
33
|
+
|
36
34
|
type Path = string;
|
37
35
|
type Alias = string;
|
38
36
|
|
@@ -12,11 +12,11 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRTransformer = require('../core/IRTransformer');
|
16
|
-
|
17
15
|
import type CompilerContext from '../core/CompilerContext';
|
18
16
|
import type {ClientExtension, Fragment, FragmentSpread} from '../core/IR';
|
19
17
|
|
18
|
+
const IRTransformer = require('../core/IRTransformer');
|
19
|
+
|
20
20
|
function skipClientExtensionTransform(
|
21
21
|
context: CompilerContext,
|
22
22
|
): CompilerContext {
|
@@ -12,11 +12,11 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRTransformer = require('../core/IRTransformer');
|
16
|
-
|
17
15
|
import type CompilerContext from '../core/CompilerContext';
|
18
16
|
import type {Field} from '../core/IR';
|
19
17
|
|
18
|
+
const IRTransformer = require('../core/IRTransformer');
|
19
|
+
|
20
20
|
/**
|
21
21
|
* A transform that removes field `handles`. Intended for use when e.g.
|
22
22
|
* printing queries to send to a GraphQL server.
|
@@ -12,17 +12,15 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRTransformer = require('../core/IRTransformer');
|
16
|
-
|
17
15
|
import type CompilerContext from '../core/CompilerContext';
|
18
|
-
|
19
|
-
const partitionArray = require('../util/partitionArray');
|
20
|
-
const getIdentifierForSelection = require('../core/getIdentifierForSelection');
|
21
|
-
const invariant = require('invariant');
|
22
|
-
|
16
|
+
import type {Fragment, Node, Root, Selection, SplitOperation} from '../core/IR';
|
23
17
|
import type {Schema} from '../core/Schema';
|
24
18
|
|
25
|
-
|
19
|
+
const getIdentifierForSelection = require('../core/getIdentifierForSelection');
|
20
|
+
const IRTransformer = require('../core/IRTransformer');
|
21
|
+
const partitionArray = require('../util/partitionArray');
|
22
|
+
const IMap = require('immutable').Map;
|
23
|
+
const invariant = require('invariant');
|
26
24
|
|
27
25
|
/**
|
28
26
|
* A simplified representation of a document: keys in the map are unique
|
@@ -12,10 +12,10 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRTransformer = require('../core/IRTransformer');
|
16
|
-
|
17
15
|
import type CompilerContext from '../core/CompilerContext';
|
18
16
|
|
17
|
+
const IRTransformer = require('../core/IRTransformer');
|
18
|
+
|
19
19
|
function skipNode() {
|
20
20
|
return null;
|
21
21
|
}
|
@@ -12,13 +12,12 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRTransformer = require('../core/IRTransformer');
|
16
|
-
|
17
|
-
const invariant = require('invariant');
|
18
|
-
|
19
15
|
import type CompilerContext from '../core/CompilerContext';
|
20
16
|
import type {Condition, Fragment, Node, Selection} from '../core/IR';
|
21
17
|
|
18
|
+
const IRTransformer = require('../core/IRTransformer');
|
19
|
+
const invariant = require('invariant');
|
20
|
+
|
22
21
|
type ConditionResult = 'fail' | 'pass' | 'variable';
|
23
22
|
|
24
23
|
const FAIL = 'fail';
|
@@ -12,11 +12,11 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const inferRootArgumentDefinitions = require('../core/inferRootArgumentDefinitions');
|
16
|
-
|
17
15
|
import type CompilerContext from '../core/CompilerContext';
|
18
16
|
import type {Root} from '../core/IR';
|
19
17
|
|
18
|
+
const inferRootArgumentDefinitions = require('../core/inferRootArgumentDefinitions');
|
19
|
+
|
20
20
|
/**
|
21
21
|
* Refines the argument definitions for operations to remove unused arguments
|
22
22
|
* due to statically pruned conditional branches (e.g. because of overriding
|
@@ -12,19 +12,18 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRTransformer = require('../core/IRTransformer');
|
16
|
-
|
17
|
-
const getNormalizationOperationName = require('../core/getNormalizationOperationName');
|
18
|
-
|
19
15
|
import type CompilerContext from '../core/CompilerContext';
|
20
16
|
import type {
|
21
|
-
LinkedField,
|
22
17
|
InlineFragment,
|
18
|
+
LinkedField,
|
23
19
|
ModuleImport,
|
24
20
|
SplitOperation,
|
25
21
|
} from '../core/IR';
|
26
22
|
import type {CompositeTypeID} from '../core/Schema';
|
27
23
|
|
24
|
+
const getNormalizationOperationName = require('../core/getNormalizationOperationName');
|
25
|
+
const IRTransformer = require('../core/IRTransformer');
|
26
|
+
|
28
27
|
type State = {|
|
29
28
|
parentType: CompositeTypeID,
|
30
29
|
splitOperations: Map<string, SplitOperation>,
|
@@ -13,12 +13,12 @@
|
|
13
13
|
|
14
14
|
'use strict';
|
15
15
|
|
16
|
-
const IRTransformer = require('../core/IRTransformer');
|
17
|
-
|
18
16
|
import type CompilerContext from '../core/CompilerContext';
|
19
17
|
import type {Root} from '../core/IR';
|
20
18
|
import type {Schema, TypeID} from '../core/Schema';
|
21
19
|
|
20
|
+
const IRTransformer = require('../core/IRTransformer');
|
21
|
+
|
22
22
|
// The purpose of this directive is to add GraphQL type inform for fields in
|
23
23
|
// the operation selection in order to use in in RelayMockPayloadGenerator
|
24
24
|
// to generate better mock values, and expand the API of MockResolvers
|
@@ -12,15 +12,14 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
import type CompilerContext from '../core/CompilerContext';
|
16
|
+
import type {ArgumentDefinition} from '../core/IR';
|
16
17
|
|
17
18
|
const {
|
18
19
|
createUserError,
|
19
20
|
eachWithCombinedError,
|
20
21
|
} = require('../core/CompilerError');
|
21
|
-
|
22
|
-
import type CompilerContext from '../core/CompilerContext';
|
23
|
-
import type {ArgumentDefinition} from '../core/IR';
|
22
|
+
const inferRootArgumentDefinitions = require('../core/inferRootArgumentDefinitions');
|
24
23
|
|
25
24
|
/**
|
26
25
|
* Validates that all global variables used in operations are defined at the
|
@@ -12,11 +12,6 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRValidator = require('../core/IRValidator');
|
16
|
-
|
17
|
-
const {createUserError} = require('../core/CompilerError');
|
18
|
-
const {getFieldDefinitionStrict} = require('../core/getFieldDefinition');
|
19
|
-
|
20
15
|
import type CompilerContext from '../core/CompilerContext';
|
21
16
|
import type {
|
22
17
|
Directive,
|
@@ -25,7 +20,11 @@ import type {
|
|
25
20
|
Root,
|
26
21
|
SplitOperation,
|
27
22
|
} from '../core/IR';
|
28
|
-
import type {Schema, TypeID
|
23
|
+
import type {Argument, Schema, TypeID} from '../core/Schema';
|
24
|
+
|
25
|
+
const {createUserError} = require('../core/CompilerError');
|
26
|
+
const {getFieldDefinitionStrict} = require('../core/getFieldDefinition');
|
27
|
+
const IRValidator = require('../core/IRValidator');
|
29
28
|
|
30
29
|
type State = {|
|
31
30
|
+rootNode: Fragment | Root | SplitOperation,
|
@@ -12,10 +12,6 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const IRValidator = require('../core/IRValidator');
|
16
|
-
|
17
|
-
const {createUserError} = require('../core/CompilerError');
|
18
|
-
|
19
15
|
import type CompilerContext from '../core/CompilerContext';
|
20
16
|
import type {
|
21
17
|
ClientExtension,
|
@@ -25,6 +21,9 @@ import type {
|
|
25
21
|
Stream,
|
26
22
|
} from '../core/IR';
|
27
23
|
|
24
|
+
const {createUserError} = require('../core/CompilerError');
|
25
|
+
const IRValidator = require('../core/IRValidator');
|
26
|
+
|
28
27
|
type State = {rootClientSelection: ?Selection, ...};
|
29
28
|
|
30
29
|
const NODEKIND_DIRECTIVE_MAP = {
|
@@ -12,15 +12,14 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
import type CompilerContext from '../core/CompilerContext';
|
16
|
+
import type {ArgumentDefinition} from '../core/IR';
|
16
17
|
|
17
18
|
const {
|
18
19
|
createUserError,
|
19
20
|
eachWithCombinedError,
|
20
21
|
} = require('../core/CompilerError');
|
21
|
-
|
22
|
-
import type CompilerContext from '../core/CompilerContext';
|
23
|
-
import type {ArgumentDefinition} from '../core/IR';
|
22
|
+
const inferRootArgumentDefinitions = require('../core/inferRootArgumentDefinitions');
|
24
23
|
|
25
24
|
const SCHEMA_EXTENSION =
|
26
25
|
'directive @DEPRECATED__relay_ignore_unused_variables_error on QUERY | MUTATION | SUBSCRIPTION';
|
@@ -12,18 +12,17 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
import type {QueryGenerator, RefetchRoot} from '.';
|
16
|
+
import type {Fragment} from '../../core/IR';
|
17
|
+
import type {Schema} from '../../core/Schema';
|
16
18
|
|
17
19
|
const {createUserError} = require('../../core/CompilerError');
|
20
|
+
const SchemaUtils = require('../../core/SchemaUtils');
|
18
21
|
const {
|
19
22
|
buildFragmentSpread,
|
20
23
|
buildOperationArgumentDefinitions,
|
21
24
|
} = require('./utils');
|
22
25
|
|
23
|
-
import type {Fragment} from '../../core/IR';
|
24
|
-
import type {Schema} from '../../core/Schema';
|
25
|
-
import type {QueryGenerator, RefetchRoot} from '.';
|
26
|
-
|
27
26
|
function buildRefetchOperation(
|
28
27
|
schema: Schema,
|
29
28
|
fragment: Fragment,
|
@@ -12,19 +12,17 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
import type {QueryGenerator, RefetchRoot} from '.';
|
16
|
+
import type {Fragment} from '../../core/IR';
|
17
|
+
import type {Schema} from '../../core/Schema';
|
18
18
|
|
19
19
|
const {createUserError} = require('../../core/CompilerError');
|
20
|
+
const SchemaUtils = require('../../core/SchemaUtils');
|
20
21
|
const {
|
21
22
|
buildFragmentSpread,
|
22
23
|
buildOperationArgumentDefinitions,
|
23
24
|
} = require('./utils');
|
24
|
-
|
25
|
-
import type {Fragment} from '../../core/IR';
|
26
|
-
import type {Schema} from '../../core/Schema';
|
27
|
-
import type {QueryGenerator, RefetchRoot} from '.';
|
25
|
+
const nullthrows = require('nullthrows');
|
28
26
|
|
29
27
|
const NODE_TYPE_NAME = 'Node';
|
30
28
|
const NODE_FIELD_NAME = 'node';
|
@@ -12,15 +12,15 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
+
import type {QueryGenerator, RefetchRoot} from '.';
|
16
|
+
import type {Fragment} from '../../core/IR';
|
17
|
+
import type {Schema} from '../../core/Schema';
|
18
|
+
|
15
19
|
const {
|
16
20
|
buildFragmentSpread,
|
17
21
|
buildOperationArgumentDefinitions,
|
18
22
|
} = require('./utils');
|
19
23
|
|
20
|
-
import type {Fragment} from '../../core/IR';
|
21
|
-
import type {Schema} from '../../core/Schema';
|
22
|
-
import type {QueryGenerator, RefetchRoot} from '.';
|
23
|
-
|
24
24
|
function buildRefetchOperation(
|
25
25
|
schema: Schema,
|
26
26
|
fragment: Fragment,
|
@@ -12,16 +12,16 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
+
import type {QueryGenerator, RefetchRoot} from '.';
|
16
|
+
import type {Fragment} from '../../core/IR';
|
17
|
+
import type {Schema} from '../../core/Schema';
|
18
|
+
|
15
19
|
const {createUserError} = require('../../core/CompilerError');
|
16
20
|
const {
|
17
21
|
buildFragmentSpread,
|
18
22
|
buildOperationArgumentDefinitions,
|
19
23
|
} = require('./utils');
|
20
24
|
|
21
|
-
import type {Fragment} from '../../core/IR';
|
22
|
-
import type {Schema} from '../../core/Schema';
|
23
|
-
import type {QueryGenerator, RefetchRoot} from '.';
|
24
|
-
|
25
25
|
const VIEWER_TYPE_NAME = 'Viewer';
|
26
26
|
const VIEWER_FIELD_NAME = 'viewer';
|
27
27
|
|
@@ -12,16 +12,15 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
+
import type {Fragment, Root} from '../../core/IR';
|
16
|
+
import type {Schema} from '../../core/Schema';
|
17
|
+
|
18
|
+
const {createUserError} = require('../../core/CompilerError');
|
15
19
|
const FetchableQueryGenerator = require('./FetchableQueryGenerator');
|
16
20
|
const NodeQueryGenerator = require('./NodeQueryGenerator');
|
17
21
|
const QueryQueryGenerator = require('./QueryQueryGenerator');
|
18
22
|
const ViewerQueryGenerator = require('./ViewerQueryGenerator');
|
19
23
|
|
20
|
-
const {createUserError} = require('../../core/CompilerError');
|
21
|
-
|
22
|
-
import type {Fragment, Root} from '../../core/IR';
|
23
|
-
import type {Schema} from '../../core/Schema';
|
24
|
-
|
25
24
|
export type RefetchRoot = {|
|
26
25
|
identifierField: ?string,
|
27
26
|
path: $ReadOnlyArray<string>,
|
@@ -13,10 +13,10 @@
|
|
13
13
|
|
14
14
|
'use strict';
|
15
15
|
|
16
|
-
const {isPromise} = require('relay-runtime');
|
17
|
-
|
18
16
|
import type {Reporter} from '../reporters/Reporter';
|
19
17
|
|
18
|
+
const {isPromise} = require('relay-runtime');
|
19
|
+
|
20
20
|
function reportTime<T>(reporter: Reporter, message: string, fn: () => T): T {
|
21
21
|
return reportAndReturnTime(reporter, message, fn)[0];
|
22
22
|
}
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
import type {
|
15
|
+
import type {NormalizationArgument, ReaderArgument} from 'relay-runtime';
|
16
16
|
|
17
17
|
function argumentContainsVariables(
|
18
18
|
arg: ?(ReaderArgument | NormalizationArgument),
|
@@ -12,10 +12,10 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const {createCompilerError} = require('../core/CompilerError');
|
16
|
-
|
17
15
|
import type {Schema, TypeID} from '../core/Schema';
|
18
16
|
|
17
|
+
const {createCompilerError} = require('../core/CompilerError');
|
18
|
+
|
19
19
|
function generateAbstractTypeRefinementKey(
|
20
20
|
schema: Schema,
|
21
21
|
type: TypeID,
|
@@ -12,12 +12,11 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
|
15
|
+
import type {ExecutableDefinitionNode} from 'graphql';
|
16
16
|
|
17
|
+
const md5 = require('./md5');
|
17
18
|
const {print} = require('graphql');
|
18
19
|
|
19
|
-
import type {ExecutableDefinitionNode} from 'graphql';
|
20
|
-
|
21
20
|
function getDefinitionNodeHash(node: ExecutableDefinitionNode): string {
|
22
21
|
return md5(print(node));
|
23
22
|
}
|
@@ -12,11 +12,11 @@
|
|
12
12
|
|
13
13
|
'use strict';
|
14
14
|
|
15
|
-
const {createUserError} = require('../core/CompilerError');
|
16
|
-
|
17
15
|
import type {ArgumentDefinition, Fragment} from '../core/IR';
|
18
16
|
import type {Schema} from '../core/Schema';
|
19
17
|
|
18
|
+
const {createUserError} = require('../core/CompilerError');
|
19
|
+
|
20
20
|
/**
|
21
21
|
* Attempts to join the argument definitions for a root fragment
|
22
22
|
* and any unmasked fragment spreads reachable from that root fragment,
|