graphql 0.12.3 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/error/GraphQLError.js +2 -3
- package/error/GraphQLError.js.flow +3 -4
- package/{module/error/GraphQLError.js → error/GraphQLError.mjs} +2 -3
- package/error/formatError.js +1 -1
- package/error/formatError.js.flow +1 -1
- package/{module/error/formatError.js → error/formatError.mjs} +1 -1
- package/error/index.js.flow +1 -1
- package/{module/error/index.js → error/index.mjs} +1 -1
- package/error/locatedError.js +2 -1
- package/error/locatedError.js.flow +2 -1
- package/{module/error/locatedError.js → error/locatedError.mjs} +2 -1
- package/error/printError.js +1 -1
- package/error/printError.js.flow +1 -1
- package/{module/error/printError.js → error/printError.mjs} +1 -1
- package/error/syntaxError.js +1 -1
- package/error/syntaxError.js.flow +1 -1
- package/{module/error/syntaxError.js → error/syntaxError.mjs} +1 -1
- package/execution/execute.js +70 -90
- package/execution/execute.js.flow +83 -106
- package/{module/execution/execute.js → execution/execute.mjs} +53 -81
- package/execution/index.js.flow +1 -1
- package/{module/execution/index.js → execution/index.mjs} +1 -1
- package/execution/values.js +2 -6
- package/execution/values.js.flow +6 -7
- package/{module/execution/values.js → execution/values.mjs} +2 -2
- package/graphql.js +1 -1
- package/graphql.js.flow +3 -2
- package/{module/graphql.js → graphql.mjs} +1 -1
- package/index.js +24 -6
- package/index.js.flow +16 -2
- package/{module/index.js → index.mjs} +10 -2
- package/jsutils/MaybePromise.js +1 -0
- package/{module/jsutils/ObjMap.js.flow → jsutils/MaybePromise.js.flow} +2 -2
- package/{module/jsutils/ObjMap.js → jsutils/MaybePromise.mjs} +0 -0
- package/jsutils/ObjMap.js.flow +1 -1
- package/{module/language/ast.js → jsutils/ObjMap.mjs} +0 -0
- package/jsutils/dedent.js +23 -18
- package/jsutils/dedent.js.flow +21 -20
- package/jsutils/dedent.mjs +50 -0
- package/jsutils/find.js +1 -1
- package/jsutils/find.js.flow +1 -1
- package/{module/jsutils/find.js → jsutils/find.mjs} +1 -1
- package/jsutils/instanceOf.js +17 -16
- package/jsutils/instanceOf.js.flow +21 -15
- package/jsutils/instanceOf.mjs +31 -0
- package/jsutils/invariant.js +1 -1
- package/jsutils/invariant.js.flow +1 -1
- package/{module/jsutils/invariant.js → jsutils/invariant.mjs} +1 -1
- package/jsutils/isInvalid.js +1 -1
- package/jsutils/isInvalid.js.flow +1 -1
- package/{module/jsutils/isInvalid.js → jsutils/isInvalid.mjs} +1 -1
- package/jsutils/isNullish.js +1 -1
- package/jsutils/isNullish.js.flow +1 -1
- package/{module/jsutils/isNullish.js → jsutils/isNullish.mjs} +1 -1
- package/jsutils/isPromise.js +24 -0
- package/jsutils/isPromise.js.flow +20 -0
- package/jsutils/isPromise.mjs +18 -0
- package/jsutils/keyMap.js +1 -1
- package/jsutils/keyMap.js.flow +1 -1
- package/{module/jsutils/keyMap.js → jsutils/keyMap.mjs} +1 -1
- package/jsutils/keyValMap.js +1 -1
- package/jsutils/keyValMap.js.flow +1 -1
- package/{module/jsutils/keyValMap.js → jsutils/keyValMap.mjs} +1 -1
- package/jsutils/memoize3.js +48 -0
- package/jsutils/memoize3.js.flow +44 -0
- package/jsutils/memoize3.mjs +42 -0
- package/jsutils/objectValues.js +24 -0
- package/jsutils/objectValues.js.flow +18 -0
- package/jsutils/objectValues.mjs +19 -0
- package/jsutils/orList.js +1 -1
- package/jsutils/orList.js.flow +1 -1
- package/{module/jsutils/orList.js → jsutils/orList.mjs} +1 -1
- package/jsutils/promiseForObject.js +34 -0
- package/jsutils/promiseForObject.js.flow +30 -0
- package/jsutils/promiseForObject.mjs +28 -0
- package/jsutils/promiseReduce.js +34 -0
- package/jsutils/promiseReduce.js.flow +32 -0
- package/jsutils/promiseReduce.mjs +26 -0
- package/jsutils/quotedOrList.js +1 -1
- package/jsutils/quotedOrList.js.flow +1 -1
- package/{module/jsutils/quotedOrList.js → jsutils/quotedOrList.mjs} +1 -1
- package/jsutils/suggestionList.js +1 -1
- package/jsutils/suggestionList.js.flow +1 -1
- package/{module/jsutils/suggestionList.js → jsutils/suggestionList.mjs} +1 -1
- package/language/ast.js.flow +3 -30
- package/language/ast.mjs +0 -0
- package/language/blockStringValue.js +1 -1
- package/language/blockStringValue.js.flow +1 -1
- package/{module/language/blockStringValue.js → language/blockStringValue.mjs} +1 -1
- package/language/directiveLocation.js +3 -3
- package/language/directiveLocation.js.flow +4 -4
- package/{module/language/directiveLocation.js → language/directiveLocation.mjs} +3 -3
- package/language/index.js +10 -10
- package/language/index.js.flow +5 -4
- package/{module/language/index.js → language/index.mjs} +3 -3
- package/language/kinds.js +70 -71
- package/language/kinds.js.flow +71 -71
- package/language/kinds.mjs +79 -0
- package/language/lexer.js +73 -87
- package/language/lexer.js.flow +87 -93
- package/{module/language/lexer.js → language/lexer.mjs} +73 -87
- package/language/location.js +1 -1
- package/language/location.js.flow +1 -1
- package/{module/language/location.js → language/location.mjs} +1 -1
- package/language/parser.js +68 -58
- package/language/parser.js.flow +104 -110
- package/{module/language/parser.js → language/parser.mjs} +69 -59
- package/language/printer.js +52 -55
- package/language/printer.js.flow +74 -120
- package/{module/language/printer.js → language/printer.mjs} +52 -55
- package/language/source.js +1 -1
- package/language/source.js.flow +1 -1
- package/{module/language/source.js → language/source.mjs} +1 -1
- package/language/visitor.js +1 -1
- package/language/visitor.js.flow +1 -1
- package/{module/language/visitor.js → language/visitor.mjs} +1 -1
- package/package.json +4 -9
- package/subscription/asyncIteratorReject.js +1 -1
- package/subscription/asyncIteratorReject.js.flow +1 -1
- package/{module/subscription/asyncIteratorReject.js → subscription/asyncIteratorReject.mjs} +1 -1
- package/subscription/index.js.flow +1 -1
- package/{module/subscription/index.js → subscription/index.mjs} +1 -1
- package/subscription/mapAsyncIterator.js +3 -1
- package/subscription/mapAsyncIterator.js.flow +7 -4
- package/{module/subscription/mapAsyncIterator.js → subscription/mapAsyncIterator.mjs} +4 -1
- package/subscription/subscribe.js +1 -1
- package/subscription/subscribe.js.flow +1 -1
- package/{module/subscription/subscribe.js → subscription/subscribe.mjs} +1 -1
- package/type/definition.js +76 -10
- package/type/definition.js.flow +105 -13
- package/{module/type/definition.js → type/definition.mjs} +72 -4
- package/type/directives.js +4 -4
- package/type/directives.js.flow +3 -3
- package/{module/type/directives.js → type/directives.mjs} +8 -8
- package/type/index.js +2 -5
- package/type/index.js.flow +6 -5
- package/{module/type/index.js → type/index.mjs} +3 -5
- package/type/introspection.js +34 -41
- package/type/introspection.js.flow +7 -10
- package/{module/type/introspection.js → type/introspection.mjs} +6 -15
- package/type/scalars.js +6 -10
- package/type/scalars.js.flow +2 -2
- package/{module/type/scalars.js → type/scalars.mjs} +2 -2
- package/type/schema.js +39 -15
- package/type/schema.js.flow +73 -22
- package/{module/type/schema.js → type/schema.mjs} +37 -16
- package/type/validate.js +33 -30
- package/type/validate.js.flow +40 -37
- package/{module/type/validate.js → type/validate.mjs} +30 -30
- package/utilities/TypeInfo.js +23 -27
- package/utilities/TypeInfo.js.flow +2 -2
- package/{module/utilities/TypeInfo.js → utilities/TypeInfo.mjs} +2 -2
- package/utilities/assertValidName.js +2 -6
- package/utilities/assertValidName.js.flow +2 -10
- package/{module/utilities/assertValidName.js → utilities/assertValidName.mjs} +2 -6
- package/utilities/astFromValue.js +37 -37
- package/utilities/astFromValue.js.flow +36 -44
- package/{module/utilities/astFromValue.js → utilities/astFromValue.mjs} +26 -25
- package/utilities/buildASTSchema.js +65 -82
- package/utilities/buildASTSchema.js.flow +52 -59
- package/{module/utilities/buildASTSchema.js → utilities/buildASTSchema.mjs} +48 -62
- package/utilities/buildClientSchema.js +12 -15
- package/utilities/buildClientSchema.js.flow +7 -11
- package/{module/utilities/buildClientSchema.js → utilities/buildClientSchema.mjs} +4 -5
- package/utilities/coerceValue.js +1 -1
- package/utilities/coerceValue.js.flow +1 -1
- package/{module/utilities/coerceValue.js → utilities/coerceValue.mjs} +1 -1
- package/utilities/concatAST.js +1 -1
- package/utilities/concatAST.js.flow +1 -1
- package/{module/utilities/concatAST.js → utilities/concatAST.mjs} +1 -1
- package/utilities/extendSchema.js +91 -77
- package/utilities/extendSchema.js.flow +93 -68
- package/{module/utilities/extendSchema.js → utilities/extendSchema.mjs} +65 -52
- package/utilities/findBreakingChanges.js +1 -1
- package/utilities/findBreakingChanges.js.flow +1 -1
- package/{module/utilities/findBreakingChanges.js → utilities/findBreakingChanges.mjs} +1 -1
- package/utilities/findDeprecatedUsages.js +1 -1
- package/utilities/findDeprecatedUsages.js.flow +1 -1
- package/{module/utilities/findDeprecatedUsages.js → utilities/findDeprecatedUsages.mjs} +1 -1
- package/utilities/getOperationAST.js +2 -2
- package/utilities/getOperationAST.js.flow +3 -3
- package/{module/utilities/getOperationAST.js → utilities/getOperationAST.mjs} +3 -3
- package/utilities/index.js +30 -0
- package/utilities/index.js.flow +10 -3
- package/{module/utilities/index.js → utilities/index.mjs} +10 -3
- package/utilities/introspectionFromSchema.js +43 -0
- package/utilities/introspectionFromSchema.js.flow +37 -0
- package/utilities/introspectionFromSchema.mjs +31 -0
- package/utilities/introspectionQuery.js +1 -1
- package/utilities/introspectionQuery.js.flow +1 -1
- package/{module/utilities/introspectionQuery.js → utilities/introspectionQuery.mjs} +1 -1
- package/utilities/isValidJSValue.js +1 -1
- package/utilities/isValidJSValue.js.flow +1 -1
- package/{module/utilities/isValidJSValue.js → utilities/isValidJSValue.mjs} +1 -1
- package/utilities/isValidLiteralValue.js +8 -4
- package/utilities/isValidLiteralValue.js.flow +4 -4
- package/{module/utilities/isValidLiteralValue.js → utilities/isValidLiteralValue.mjs} +4 -4
- package/utilities/lexicographicSortSchema.js +243 -0
- package/utilities/lexicographicSortSchema.js.flow +198 -0
- package/utilities/lexicographicSortSchema.mjs +225 -0
- package/utilities/schemaPrinter.js +31 -29
- package/utilities/schemaPrinter.js.flow +28 -15
- package/{module/utilities/schemaPrinter.js → utilities/schemaPrinter.mjs} +21 -20
- package/utilities/separateOperations.js +1 -1
- package/utilities/separateOperations.js.flow +1 -1
- package/{module/utilities/separateOperations.js → utilities/separateOperations.mjs} +1 -1
- package/utilities/typeComparators.js +7 -10
- package/utilities/typeComparators.js.flow +7 -10
- package/{module/utilities/typeComparators.js → utilities/typeComparators.mjs} +7 -10
- package/utilities/typeFromAST.js +7 -11
- package/utilities/typeFromAST.js.flow +3 -3
- package/{module/utilities/typeFromAST.js → utilities/typeFromAST.mjs} +3 -3
- package/utilities/valueFromAST.js +26 -28
- package/utilities/valueFromAST.js.flow +14 -23
- package/{module/utilities/valueFromAST.js → utilities/valueFromAST.mjs} +9 -10
- package/utilities/valueFromASTUntyped.js +17 -22
- package/utilities/valueFromASTUntyped.js.flow +6 -7
- package/{module/utilities/valueFromASTUntyped.js → utilities/valueFromASTUntyped.mjs} +6 -7
- package/validation/ValidationContext.js +184 -0
- package/{module/validation/validate.js.flow → validation/ValidationContext.js.flow} +4 -60
- package/{module/validation/validate.js → validation/ValidationContext.mjs} +15 -57
- package/validation/index.js +12 -7
- package/validation/index.js.flow +6 -2
- package/{module/validation/index.js → validation/index.mjs} +6 -2
- package/validation/rules/ExecutableDefinitions.js +3 -3
- package/validation/rules/ExecutableDefinitions.js.flow +6 -10
- package/{module/validation/rules/ExecutableDefinitions.js → validation/rules/ExecutableDefinitions.mjs} +4 -4
- package/validation/rules/FieldsOnCorrectType.js +1 -1
- package/validation/rules/FieldsOnCorrectType.js.flow +2 -2
- package/{module/validation/rules/FieldsOnCorrectType.js → validation/rules/FieldsOnCorrectType.mjs} +1 -1
- package/validation/rules/FragmentsOnCompositeTypes.js +1 -1
- package/validation/rules/FragmentsOnCompositeTypes.js.flow +2 -2
- package/{module/validation/rules/FragmentsOnCompositeTypes.js → validation/rules/FragmentsOnCompositeTypes.mjs} +1 -1
- package/validation/rules/KnownArgumentNames.js +3 -3
- package/validation/rules/KnownArgumentNames.js.flow +6 -8
- package/{module/validation/rules/KnownArgumentNames.js → validation/rules/KnownArgumentNames.mjs} +4 -4
- package/validation/rules/KnownDirectives.js +23 -27
- package/validation/rules/KnownDirectives.js.flow +3 -3
- package/{module/validation/rules/KnownDirectives.js → validation/rules/KnownDirectives.mjs} +2 -2
- package/validation/rules/KnownFragmentNames.js +1 -1
- package/validation/rules/KnownFragmentNames.js.flow +2 -2
- package/{module/validation/rules/KnownFragmentNames.js → validation/rules/KnownFragmentNames.mjs} +1 -1
- package/validation/rules/KnownTypeNames.js +1 -1
- package/validation/rules/KnownTypeNames.js.flow +2 -2
- package/{module/validation/rules/KnownTypeNames.js → validation/rules/KnownTypeNames.mjs} +1 -1
- package/validation/rules/LoneAnonymousOperation.js +2 -2
- package/validation/rules/LoneAnonymousOperation.js.flow +4 -4
- package/{module/validation/rules/LoneAnonymousOperation.js → validation/rules/LoneAnonymousOperation.mjs} +3 -3
- package/validation/rules/NoFragmentCycles.js +1 -1
- package/validation/rules/NoFragmentCycles.js.flow +2 -2
- package/{module/validation/rules/NoFragmentCycles.js → validation/rules/NoFragmentCycles.mjs} +1 -1
- package/validation/rules/NoUndefinedVariables.js +1 -1
- package/validation/rules/NoUndefinedVariables.js.flow +2 -2
- package/{module/validation/rules/NoUndefinedVariables.js → validation/rules/NoUndefinedVariables.mjs} +1 -1
- package/validation/rules/NoUnusedFragments.js +1 -1
- package/validation/rules/NoUnusedFragments.js.flow +2 -2
- package/{module/validation/rules/NoUnusedFragments.js → validation/rules/NoUnusedFragments.mjs} +1 -1
- package/validation/rules/NoUnusedVariables.js +1 -1
- package/validation/rules/NoUnusedVariables.js.flow +2 -2
- package/{module/validation/rules/NoUnusedVariables.js → validation/rules/NoUnusedVariables.mjs} +1 -1
- package/validation/rules/OverlappingFieldsCanBeMerged.js +4 -8
- package/validation/rules/OverlappingFieldsCanBeMerged.js.flow +3 -3
- package/{module/validation/rules/OverlappingFieldsCanBeMerged.js → validation/rules/OverlappingFieldsCanBeMerged.mjs} +2 -2
- package/validation/rules/PossibleFragmentSpreads.js +1 -1
- package/validation/rules/PossibleFragmentSpreads.js.flow +2 -2
- package/{module/validation/rules/PossibleFragmentSpreads.js → validation/rules/PossibleFragmentSpreads.mjs} +1 -1
- package/validation/rules/ProvidedNonNullArguments.js +1 -1
- package/validation/rules/ProvidedNonNullArguments.js.flow +2 -2
- package/{module/validation/rules/ProvidedNonNullArguments.js → validation/rules/ProvidedNonNullArguments.mjs} +1 -1
- package/validation/rules/ScalarLeafs.js +1 -1
- package/validation/rules/ScalarLeafs.js.flow +2 -2
- package/{module/validation/rules/ScalarLeafs.js → validation/rules/ScalarLeafs.mjs} +1 -1
- package/validation/rules/SingleFieldSubscriptions.js +1 -1
- package/validation/rules/SingleFieldSubscriptions.js.flow +2 -2
- package/{module/validation/rules/SingleFieldSubscriptions.js → validation/rules/SingleFieldSubscriptions.mjs} +1 -1
- package/validation/rules/UniqueArgumentNames.js +1 -1
- package/validation/rules/UniqueArgumentNames.js.flow +2 -2
- package/{module/validation/rules/UniqueArgumentNames.js → validation/rules/UniqueArgumentNames.mjs} +1 -1
- package/validation/rules/UniqueDirectivesPerLocation.js +1 -1
- package/validation/rules/UniqueDirectivesPerLocation.js.flow +2 -2
- package/{module/validation/rules/UniqueDirectivesPerLocation.js → validation/rules/UniqueDirectivesPerLocation.mjs} +1 -1
- package/validation/rules/UniqueFragmentNames.js +1 -1
- package/validation/rules/UniqueFragmentNames.js.flow +2 -2
- package/{module/validation/rules/UniqueFragmentNames.js → validation/rules/UniqueFragmentNames.mjs} +1 -1
- package/validation/rules/UniqueInputFieldNames.js +1 -1
- package/validation/rules/UniqueInputFieldNames.js.flow +2 -2
- package/{module/validation/rules/UniqueInputFieldNames.js → validation/rules/UniqueInputFieldNames.mjs} +1 -1
- package/validation/rules/UniqueOperationNames.js +1 -1
- package/validation/rules/UniqueOperationNames.js.flow +2 -2
- package/{module/validation/rules/UniqueOperationNames.js → validation/rules/UniqueOperationNames.mjs} +1 -1
- package/validation/rules/UniqueVariableNames.js +1 -1
- package/validation/rules/UniqueVariableNames.js.flow +2 -2
- package/{module/validation/rules/UniqueVariableNames.js → validation/rules/UniqueVariableNames.mjs} +1 -1
- package/validation/rules/ValuesOfCorrectType.js +1 -1
- package/validation/rules/ValuesOfCorrectType.js.flow +2 -2
- package/{module/validation/rules/ValuesOfCorrectType.js → validation/rules/ValuesOfCorrectType.mjs} +1 -1
- package/validation/rules/VariablesAreInputTypes.js +1 -1
- package/validation/rules/VariablesAreInputTypes.js.flow +2 -2
- package/{module/validation/rules/VariablesAreInputTypes.js → validation/rules/VariablesAreInputTypes.mjs} +1 -1
- package/validation/rules/VariablesDefaultValueAllowed.js +1 -1
- package/validation/rules/VariablesDefaultValueAllowed.js.flow +2 -2
- package/{module/validation/rules/VariablesDefaultValueAllowed.js → validation/rules/VariablesDefaultValueAllowed.mjs} +1 -1
- package/validation/rules/VariablesInAllowedPosition.js +9 -11
- package/validation/rules/VariablesInAllowedPosition.js.flow +3 -4
- package/{module/validation/rules/VariablesInAllowedPosition.js → validation/rules/VariablesInAllowedPosition.mjs} +2 -3
- package/validation/specifiedRules.js +1 -1
- package/validation/specifiedRules.js.flow +2 -2
- package/{module/validation/specifiedRules.js → validation/specifiedRules.mjs} +1 -1
- package/validation/validate.js +14 -175
- package/validation/validate.js.flow +3 -209
- package/validation/validate.mjs +57 -0
- package/module/error/GraphQLError.js.flow +0 -209
- package/module/error/formatError.js.flow +0 -34
- package/module/error/index.js.flow +0 -16
- package/module/error/locatedError.js.flow +0 -37
- package/module/error/printError.js.flow +0 -82
- package/module/error/syntaxError.js.flow +0 -25
- package/module/execution/execute.js.flow +0 -1375
- package/module/execution/index.js.flow +0 -13
- package/module/execution/values.js.flow +0 -206
- package/module/graphql.js.flow +0 -202
- package/module/index.js.flow +0 -389
- package/module/jsutils/dedent.js +0 -45
- package/module/jsutils/dedent.js.flow +0 -49
- package/module/jsutils/find.js.flow +0 -19
- package/module/jsutils/instanceOf.js +0 -27
- package/module/jsutils/instanceOf.js.flow +0 -44
- package/module/jsutils/invariant.js.flow +0 -15
- package/module/jsutils/isInvalid.js.flow +0 -15
- package/module/jsutils/isNullish.js.flow +0 -15
- package/module/jsutils/keyMap.js.flow +0 -43
- package/module/jsutils/keyValMap.js.flow +0 -38
- package/module/jsutils/orList.js.flow +0 -24
- package/module/jsutils/quotedOrList.js.flow +0 -17
- package/module/jsutils/suggestionList.js.flow +0 -94
- package/module/language/ast.js.flow +0 -594
- package/module/language/blockStringValue.js.flow +0 -64
- package/module/language/directiveLocation.js.flow +0 -39
- package/module/language/index.js.flow +0 -84
- package/module/language/kinds.js +0 -80
- package/module/language/kinds.js.flow +0 -80
- package/module/language/lexer.js.flow +0 -762
- package/module/language/location.js.flow +0 -34
- package/module/language/parser.js.flow +0 -1537
- package/module/language/printer.js.flow +0 -311
- package/module/language/source.js.flow +0 -43
- package/module/language/visitor.js.flow +0 -476
- package/module/subscription/asyncIteratorReject.js.flow +0 -41
- package/module/subscription/index.js.flow +0 -10
- package/module/subscription/mapAsyncIterator.js.flow +0 -78
- package/module/subscription/subscribe.js.flow +0 -288
- package/module/type/definition.js.flow +0 -1225
- package/module/type/directives.js.flow +0 -168
- package/module/type/index.js.flow +0 -156
- package/module/type/introspection.js.flow +0 -482
- package/module/type/scalars.js.flow +0 -158
- package/module/type/schema.js.flow +0 -271
- package/module/type/validate.js.flow +0 -723
- package/module/type/wrappers.js +0 -80
- package/module/type/wrappers.js.flow +0 -91
- package/module/utilities/TypeInfo.js.flow +0 -296
- package/module/utilities/assertValidName.js.flow +0 -56
- package/module/utilities/astFromValue.js.flow +0 -159
- package/module/utilities/buildASTSchema.js.flow +0 -518
- package/module/utilities/buildClientSchema.js.flow +0 -418
- package/module/utilities/coerceValue.js.flow +0 -257
- package/module/utilities/concatAST.js.flow +0 -29
- package/module/utilities/extendSchema.js.flow +0 -374
- package/module/utilities/findBreakingChanges.js.flow +0 -851
- package/module/utilities/findDeprecatedUsages.js.flow +0 -68
- package/module/utilities/getOperationAST.js.flow +0 -40
- package/module/utilities/index.js.flow +0 -111
- package/module/utilities/introspectionQuery.js.flow +0 -271
- package/module/utilities/isValidJSValue.js.flow +0 -22
- package/module/utilities/isValidLiteralValue.js.flow +0 -36
- package/module/utilities/schemaPrinter.js.flow +0 -402
- package/module/utilities/separateOperations.js.flow +0 -100
- package/module/utilities/typeComparators.js.flow +0 -135
- package/module/utilities/typeFromAST.js.flow +0 -56
- package/module/utilities/valueFromAST.js.flow +0 -184
- package/module/utilities/valueFromASTUntyped.js.flow +0 -64
- package/module/validation/index.js.flow +0 -138
- package/module/validation/rules/ExecutableDefinitions.js.flow +0 -52
- package/module/validation/rules/FieldsOnCorrectType.js.flow +0 -144
- package/module/validation/rules/FragmentsOnCompositeTypes.js.flow +0 -74
- package/module/validation/rules/KnownArgumentNames.js.flow +0 -98
- package/module/validation/rules/KnownDirectives.js.flow +0 -116
- package/module/validation/rules/KnownFragmentNames.js.flow +0 -36
- package/module/validation/rules/KnownTypeNames.js.flow +0 -59
- package/module/validation/rules/LoneAnonymousOperation.js.flow +0 -41
- package/module/validation/rules/NoFragmentCycles.js.flow +0 -85
- package/module/validation/rules/NoUndefinedVariables.js.flow +0 -57
- package/module/validation/rules/NoUnusedFragments.js.flow +0 -59
- package/module/validation/rules/NoUnusedVariables.js.flow +0 -62
- package/module/validation/rules/OverlappingFieldsCanBeMerged.js.flow +0 -847
- package/module/validation/rules/PossibleFragmentSpreads.js.flow +0 -94
- package/module/validation/rules/ProvidedNonNullArguments.js.flow +0 -105
- package/module/validation/rules/ScalarLeafs.js.flow +0 -69
- package/module/validation/rules/SingleFieldSubscriptions.js.flow +0 -44
- package/module/validation/rules/UniqueArgumentNames.js.flow +0 -48
- package/module/validation/rules/UniqueDirectivesPerLocation.js.flow +0 -57
- package/module/validation/rules/UniqueFragmentNames.js.flow +0 -42
- package/module/validation/rules/UniqueInputFieldNames.js.flow +0 -53
- package/module/validation/rules/UniqueOperationNames.js.flow +0 -44
- package/module/validation/rules/UniqueVariableNames.js.flow +0 -44
- package/module/validation/rules/ValuesOfCorrectType.js.flow +0 -218
- package/module/validation/rules/VariablesAreInputTypes.js.flow +0 -48
- package/module/validation/rules/VariablesDefaultValueAllowed.js.flow +0 -55
- package/module/validation/rules/VariablesInAllowedPosition.js.flow +0 -83
- package/module/validation/specifiedRules.js.flow +0 -127
- package/type/wrappers.js +0 -89
- package/type/wrappers.js.flow +0 -91
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export { execute, defaultFieldResolver, responsePathAsArray } from './execute';
|
|
11
|
-
export { getDirectiveValues } from './values';
|
|
12
|
-
|
|
13
|
-
export type { ExecutionArgs, ExecutionResult } from './execute';
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { GraphQLError } from '../error';
|
|
11
|
-
import find from '../jsutils/find';
|
|
12
|
-
import isInvalid from '../jsutils/isInvalid';
|
|
13
|
-
import keyMap from '../jsutils/keyMap';
|
|
14
|
-
import { coerceValue } from '../utilities/coerceValue';
|
|
15
|
-
import { typeFromAST } from '../utilities/typeFromAST';
|
|
16
|
-
import { valueFromAST } from '../utilities/valueFromAST';
|
|
17
|
-
import * as Kind from '../language/kinds';
|
|
18
|
-
import { print } from '../language/printer';
|
|
19
|
-
import { isInputType, isNonNullType } from '../type/definition';
|
|
20
|
-
import type { ObjMap } from '../jsutils/ObjMap';
|
|
21
|
-
import type { GraphQLField } from '../type/definition';
|
|
22
|
-
import type { GraphQLDirective } from '../type/directives';
|
|
23
|
-
import type { GraphQLSchema } from '../type/schema';
|
|
24
|
-
import type {
|
|
25
|
-
FieldNode,
|
|
26
|
-
DirectiveNode,
|
|
27
|
-
VariableNode,
|
|
28
|
-
VariableDefinitionNode,
|
|
29
|
-
} from '../language/ast';
|
|
30
|
-
|
|
31
|
-
type CoercedVariableValues = {|
|
|
32
|
-
errors: $ReadOnlyArray<GraphQLError> | void,
|
|
33
|
-
coerced: { [variable: string]: mixed } | void,
|
|
34
|
-
|};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Prepares an object map of variableValues of the correct type based on the
|
|
38
|
-
* provided variable definitions and arbitrary input. If the input cannot be
|
|
39
|
-
* parsed to match the variable definitions, a GraphQLError will be thrown.
|
|
40
|
-
*
|
|
41
|
-
* Note: The returned value is a plain Object with a prototype, since it is
|
|
42
|
-
* exposed to user code. Care should be taken to not pull values from the
|
|
43
|
-
* Object prototype.
|
|
44
|
-
*/
|
|
45
|
-
export function getVariableValues(
|
|
46
|
-
schema: GraphQLSchema,
|
|
47
|
-
varDefNodes: Array<VariableDefinitionNode>,
|
|
48
|
-
inputs: ObjMap<mixed>,
|
|
49
|
-
): CoercedVariableValues {
|
|
50
|
-
const errors = [];
|
|
51
|
-
const coercedValues = {};
|
|
52
|
-
for (let i = 0; i < varDefNodes.length; i++) {
|
|
53
|
-
const varDefNode = varDefNodes[i];
|
|
54
|
-
const varName = varDefNode.variable.name.value;
|
|
55
|
-
const varType = typeFromAST(schema, varDefNode.type);
|
|
56
|
-
if (!isInputType(varType)) {
|
|
57
|
-
errors.push(
|
|
58
|
-
new GraphQLError(
|
|
59
|
-
`Variable "$${varName}" expected value of type ` +
|
|
60
|
-
`"${print(
|
|
61
|
-
varDefNode.type,
|
|
62
|
-
)}" which cannot be used as an input type.`,
|
|
63
|
-
[varDefNode.type],
|
|
64
|
-
),
|
|
65
|
-
);
|
|
66
|
-
} else {
|
|
67
|
-
const value = inputs[varName];
|
|
68
|
-
if (isInvalid(value)) {
|
|
69
|
-
if (isNonNullType(varType)) {
|
|
70
|
-
errors.push(
|
|
71
|
-
new GraphQLError(
|
|
72
|
-
`Variable "$${varName}" of required type ` +
|
|
73
|
-
`"${String(varType)}" was not provided.`,
|
|
74
|
-
[varDefNode],
|
|
75
|
-
),
|
|
76
|
-
);
|
|
77
|
-
} else if (varDefNode.defaultValue) {
|
|
78
|
-
coercedValues[varName] = valueFromAST(
|
|
79
|
-
varDefNode.defaultValue,
|
|
80
|
-
varType,
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
const coerced = coerceValue(value, varType, varDefNode);
|
|
85
|
-
const coercionErrors = coerced.errors;
|
|
86
|
-
if (coercionErrors) {
|
|
87
|
-
const messagePrelude = `Variable "$${
|
|
88
|
-
varName
|
|
89
|
-
}" got invalid value ${JSON.stringify(value)}; `;
|
|
90
|
-
coercionErrors.forEach(error => {
|
|
91
|
-
error.message = messagePrelude + error.message;
|
|
92
|
-
});
|
|
93
|
-
errors.push(...coercionErrors);
|
|
94
|
-
} else {
|
|
95
|
-
coercedValues[varName] = coerced.value;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return errors.length === 0
|
|
101
|
-
? { errors: undefined, coerced: coercedValues }
|
|
102
|
-
: { errors, coerced: undefined };
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Prepares an object map of argument values given a list of argument
|
|
107
|
-
* definitions and list of argument AST nodes.
|
|
108
|
-
*
|
|
109
|
-
* Note: The returned value is a plain Object with a prototype, since it is
|
|
110
|
-
* exposed to user code. Care should be taken to not pull values from the
|
|
111
|
-
* Object prototype.
|
|
112
|
-
*/
|
|
113
|
-
export function getArgumentValues(
|
|
114
|
-
def: GraphQLField<*, *> | GraphQLDirective,
|
|
115
|
-
node: FieldNode | DirectiveNode,
|
|
116
|
-
variableValues?: ?ObjMap<mixed>,
|
|
117
|
-
): { [argument: string]: mixed } {
|
|
118
|
-
const coercedValues = {};
|
|
119
|
-
const argDefs = def.args;
|
|
120
|
-
const argNodes = node.arguments;
|
|
121
|
-
if (!argDefs || !argNodes) {
|
|
122
|
-
return coercedValues;
|
|
123
|
-
}
|
|
124
|
-
const argNodeMap = keyMap(argNodes, arg => arg.name.value);
|
|
125
|
-
for (let i = 0; i < argDefs.length; i++) {
|
|
126
|
-
const argDef = argDefs[i];
|
|
127
|
-
const name = argDef.name;
|
|
128
|
-
const argType = argDef.type;
|
|
129
|
-
const argumentNode = argNodeMap[name];
|
|
130
|
-
const defaultValue = argDef.defaultValue;
|
|
131
|
-
if (!argumentNode) {
|
|
132
|
-
if (!isInvalid(defaultValue)) {
|
|
133
|
-
coercedValues[name] = defaultValue;
|
|
134
|
-
} else if (isNonNullType(argType)) {
|
|
135
|
-
throw new GraphQLError(
|
|
136
|
-
`Argument "${name}" of required type ` +
|
|
137
|
-
`"${String(argType)}" was not provided.`,
|
|
138
|
-
[node],
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
} else if (argumentNode.value.kind === Kind.VARIABLE) {
|
|
142
|
-
const variableName = (argumentNode.value: VariableNode).name.value;
|
|
143
|
-
if (
|
|
144
|
-
variableValues &&
|
|
145
|
-
Object.prototype.hasOwnProperty.call(variableValues, variableName) &&
|
|
146
|
-
!isInvalid(variableValues[variableName])
|
|
147
|
-
) {
|
|
148
|
-
// Note: this does not check that this variable value is correct.
|
|
149
|
-
// This assumes that this query has been validated and the variable
|
|
150
|
-
// usage here is of the correct type.
|
|
151
|
-
coercedValues[name] = variableValues[variableName];
|
|
152
|
-
} else if (!isInvalid(defaultValue)) {
|
|
153
|
-
coercedValues[name] = defaultValue;
|
|
154
|
-
} else if (isNonNullType(argType)) {
|
|
155
|
-
throw new GraphQLError(
|
|
156
|
-
`Argument "${name}" of required type "${String(argType)}" was ` +
|
|
157
|
-
`provided the variable "$${variableName}" which was not provided ` +
|
|
158
|
-
'a runtime value.',
|
|
159
|
-
[argumentNode.value],
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
} else {
|
|
163
|
-
const valueNode = argumentNode.value;
|
|
164
|
-
const coercedValue = valueFromAST(valueNode, argType, variableValues);
|
|
165
|
-
if (isInvalid(coercedValue)) {
|
|
166
|
-
// Note: ValuesOfCorrectType validation should catch this before
|
|
167
|
-
// execution. This is a runtime check to ensure execution does not
|
|
168
|
-
// continue with an invalid argument value.
|
|
169
|
-
throw new GraphQLError(
|
|
170
|
-
`Argument "${name}" has invalid value ${print(valueNode)}.`,
|
|
171
|
-
[argumentNode.value],
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
coercedValues[name] = coercedValue;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return coercedValues;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Prepares an object map of argument values given a directive definition
|
|
182
|
-
* and a AST node which may contain directives. Optionally also accepts a map
|
|
183
|
-
* of variable values.
|
|
184
|
-
*
|
|
185
|
-
* If the directive does not exist on the node, returns undefined.
|
|
186
|
-
*
|
|
187
|
-
* Note: The returned value is a plain Object with a prototype, since it is
|
|
188
|
-
* exposed to user code. Care should be taken to not pull values from the
|
|
189
|
-
* Object prototype.
|
|
190
|
-
*/
|
|
191
|
-
export function getDirectiveValues(
|
|
192
|
-
directiveDef: GraphQLDirective,
|
|
193
|
-
node: { +directives?: $ReadOnlyArray<DirectiveNode> },
|
|
194
|
-
variableValues?: ?ObjMap<mixed>,
|
|
195
|
-
): void | { [argument: string]: mixed } {
|
|
196
|
-
const directiveNode =
|
|
197
|
-
node.directives &&
|
|
198
|
-
find(
|
|
199
|
-
node.directives,
|
|
200
|
-
directive => directive.name.value === directiveDef.name,
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
if (directiveNode) {
|
|
204
|
-
return getArgumentValues(directiveDef, directiveNode, variableValues);
|
|
205
|
-
}
|
|
206
|
-
}
|
package/module/graphql.js.flow
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { validateSchema } from './type/validate';
|
|
11
|
-
import { parse } from './language/parser';
|
|
12
|
-
import { validate } from './validation/validate';
|
|
13
|
-
import { execute } from './execution/execute';
|
|
14
|
-
import type { ObjMap } from './jsutils/ObjMap';
|
|
15
|
-
import type { Source } from './language/source';
|
|
16
|
-
import type { GraphQLFieldResolver } from './type/definition';
|
|
17
|
-
import type { GraphQLSchema } from './type/schema';
|
|
18
|
-
import type { ExecutionResult } from './execution/execute';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* This is the primary entry point function for fulfilling GraphQL operations
|
|
22
|
-
* by parsing, validating, and executing a GraphQL document along side a
|
|
23
|
-
* GraphQL schema.
|
|
24
|
-
*
|
|
25
|
-
* More sophisticated GraphQL servers, such as those which persist queries,
|
|
26
|
-
* may wish to separate the validation and execution phases to a static time
|
|
27
|
-
* tooling step, and a server runtime step.
|
|
28
|
-
*
|
|
29
|
-
* Accepts either an object with named arguments, or individual arguments:
|
|
30
|
-
*
|
|
31
|
-
* schema:
|
|
32
|
-
* The GraphQL type system to use when validating and executing a query.
|
|
33
|
-
* source:
|
|
34
|
-
* A GraphQL language formatted string representing the requested operation.
|
|
35
|
-
* rootValue:
|
|
36
|
-
* The value provided as the first argument to resolver functions on the top
|
|
37
|
-
* level type (e.g. the query object type).
|
|
38
|
-
* variableValues:
|
|
39
|
-
* A mapping of variable name to runtime value to use for all variables
|
|
40
|
-
* defined in the requestString.
|
|
41
|
-
* operationName:
|
|
42
|
-
* The name of the operation to use if requestString contains multiple
|
|
43
|
-
* possible operations. Can be omitted if requestString contains only
|
|
44
|
-
* one operation.
|
|
45
|
-
* fieldResolver:
|
|
46
|
-
* A resolver function to use when one is not provided by the schema.
|
|
47
|
-
* If not provided, the default field resolver is used (which looks for a
|
|
48
|
-
* value or method on the source value with the field's name).
|
|
49
|
-
*/
|
|
50
|
-
export type GraphQLArgs = {|
|
|
51
|
-
schema: GraphQLSchema,
|
|
52
|
-
source: string | Source,
|
|
53
|
-
rootValue?: mixed,
|
|
54
|
-
contextValue?: mixed,
|
|
55
|
-
variableValues?: ?ObjMap<mixed>,
|
|
56
|
-
operationName?: ?string,
|
|
57
|
-
fieldResolver?: ?GraphQLFieldResolver<any, any>,
|
|
58
|
-
|};
|
|
59
|
-
declare function graphql(GraphQLArgs, ..._: []): Promise<ExecutionResult>;
|
|
60
|
-
/* eslint-disable no-redeclare */
|
|
61
|
-
declare function graphql(
|
|
62
|
-
schema: GraphQLSchema,
|
|
63
|
-
source: Source | string,
|
|
64
|
-
rootValue?: mixed,
|
|
65
|
-
contextValue?: mixed,
|
|
66
|
-
variableValues?: ?ObjMap<mixed>,
|
|
67
|
-
operationName?: ?string,
|
|
68
|
-
fieldResolver?: ?GraphQLFieldResolver<any, any>,
|
|
69
|
-
): Promise<ExecutionResult>;
|
|
70
|
-
export function graphql(
|
|
71
|
-
argsOrSchema,
|
|
72
|
-
source,
|
|
73
|
-
rootValue,
|
|
74
|
-
contextValue,
|
|
75
|
-
variableValues,
|
|
76
|
-
operationName,
|
|
77
|
-
fieldResolver,
|
|
78
|
-
) {
|
|
79
|
-
/* eslint-enable no-redeclare */
|
|
80
|
-
// Always return a Promise for a consistent API.
|
|
81
|
-
return new Promise(resolve =>
|
|
82
|
-
resolve(
|
|
83
|
-
// Extract arguments from object args if provided.
|
|
84
|
-
arguments.length === 1
|
|
85
|
-
? graphqlImpl(
|
|
86
|
-
argsOrSchema.schema,
|
|
87
|
-
argsOrSchema.source,
|
|
88
|
-
argsOrSchema.rootValue,
|
|
89
|
-
argsOrSchema.contextValue,
|
|
90
|
-
argsOrSchema.variableValues,
|
|
91
|
-
argsOrSchema.operationName,
|
|
92
|
-
argsOrSchema.fieldResolver,
|
|
93
|
-
)
|
|
94
|
-
: graphqlImpl(
|
|
95
|
-
argsOrSchema,
|
|
96
|
-
source,
|
|
97
|
-
rootValue,
|
|
98
|
-
contextValue,
|
|
99
|
-
variableValues,
|
|
100
|
-
operationName,
|
|
101
|
-
fieldResolver,
|
|
102
|
-
),
|
|
103
|
-
),
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The graphqlSync function also fulfills GraphQL operations by parsing,
|
|
109
|
-
* validating, and executing a GraphQL document along side a GraphQL schema.
|
|
110
|
-
* However, it guarantees to complete synchronously (or throw an error) assuming
|
|
111
|
-
* that all field resolvers are also synchronous.
|
|
112
|
-
*/
|
|
113
|
-
declare function graphqlSync(GraphQLArgs, ..._: []): ExecutionResult;
|
|
114
|
-
/* eslint-disable no-redeclare */
|
|
115
|
-
declare function graphqlSync(
|
|
116
|
-
schema: GraphQLSchema,
|
|
117
|
-
source: Source | string,
|
|
118
|
-
rootValue?: mixed,
|
|
119
|
-
contextValue?: mixed,
|
|
120
|
-
variableValues?: ?ObjMap<mixed>,
|
|
121
|
-
operationName?: ?string,
|
|
122
|
-
fieldResolver?: ?GraphQLFieldResolver<any, any>,
|
|
123
|
-
): ExecutionResult;
|
|
124
|
-
export function graphqlSync(
|
|
125
|
-
argsOrSchema,
|
|
126
|
-
source,
|
|
127
|
-
rootValue,
|
|
128
|
-
contextValue,
|
|
129
|
-
variableValues,
|
|
130
|
-
operationName,
|
|
131
|
-
fieldResolver,
|
|
132
|
-
) {
|
|
133
|
-
// Extract arguments from object args if provided.
|
|
134
|
-
const result =
|
|
135
|
-
arguments.length === 1
|
|
136
|
-
? graphqlImpl(
|
|
137
|
-
argsOrSchema.schema,
|
|
138
|
-
argsOrSchema.source,
|
|
139
|
-
argsOrSchema.rootValue,
|
|
140
|
-
argsOrSchema.contextValue,
|
|
141
|
-
argsOrSchema.variableValues,
|
|
142
|
-
argsOrSchema.operationName,
|
|
143
|
-
argsOrSchema.fieldResolver,
|
|
144
|
-
)
|
|
145
|
-
: graphqlImpl(
|
|
146
|
-
argsOrSchema,
|
|
147
|
-
source,
|
|
148
|
-
rootValue,
|
|
149
|
-
contextValue,
|
|
150
|
-
variableValues,
|
|
151
|
-
operationName,
|
|
152
|
-
fieldResolver,
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
// Assert that the execution was synchronous.
|
|
156
|
-
if (result.then) {
|
|
157
|
-
throw new Error('GraphQL execution failed to complete synchronously.');
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return result;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function graphqlImpl(
|
|
164
|
-
schema,
|
|
165
|
-
source,
|
|
166
|
-
rootValue,
|
|
167
|
-
contextValue,
|
|
168
|
-
variableValues,
|
|
169
|
-
operationName,
|
|
170
|
-
fieldResolver,
|
|
171
|
-
): Promise<ExecutionResult> | ExecutionResult {
|
|
172
|
-
// Validate Schema
|
|
173
|
-
const schemaValidationErrors = validateSchema(schema);
|
|
174
|
-
if (schemaValidationErrors.length > 0) {
|
|
175
|
-
return { errors: schemaValidationErrors };
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// Parse
|
|
179
|
-
let document;
|
|
180
|
-
try {
|
|
181
|
-
document = parse(source);
|
|
182
|
-
} catch (syntaxError) {
|
|
183
|
-
return { errors: [syntaxError] };
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Validate
|
|
187
|
-
const validationErrors = validate(schema, document);
|
|
188
|
-
if (validationErrors.length > 0) {
|
|
189
|
-
return { errors: validationErrors };
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Execute
|
|
193
|
-
return execute(
|
|
194
|
-
schema,
|
|
195
|
-
document,
|
|
196
|
-
rootValue,
|
|
197
|
-
contextValue,
|
|
198
|
-
variableValues,
|
|
199
|
-
operationName,
|
|
200
|
-
fieldResolver,
|
|
201
|
-
);
|
|
202
|
-
}
|