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
package/language/printer.js.flow
CHANGED
|
@@ -85,7 +85,7 @@ const printDocASTReducer = {
|
|
|
85
85
|
isBlockString
|
|
86
86
|
? printBlockString(value, key === 'description')
|
|
87
87
|
: JSON.stringify(value),
|
|
88
|
-
BooleanValue: ({ value }) =>
|
|
88
|
+
BooleanValue: ({ value }) => (value ? 'true' : 'false'),
|
|
89
89
|
NullValue: () => 'null',
|
|
90
90
|
EnumValue: ({ value }) => value,
|
|
91
91
|
ListValue: ({ values }) => '[' + join(values, ', ') + ']',
|
|
@@ -110,113 +110,68 @@ const printDocASTReducer = {
|
|
|
110
110
|
|
|
111
111
|
OperationTypeDefinition: ({ operation, type }) => operation + ': ' + type,
|
|
112
112
|
|
|
113
|
-
ScalarTypeDefinition: ({
|
|
114
|
-
join(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
'\n',
|
|
154
|
-
),
|
|
155
|
-
|
|
156
|
-
InputValueDefinition: ({
|
|
157
|
-
description,
|
|
158
|
-
name,
|
|
159
|
-
type,
|
|
160
|
-
defaultValue,
|
|
161
|
-
directives,
|
|
162
|
-
}) =>
|
|
163
|
-
join(
|
|
164
|
-
[
|
|
165
|
-
description,
|
|
166
|
-
join(
|
|
167
|
-
[name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],
|
|
168
|
-
' ',
|
|
169
|
-
),
|
|
170
|
-
],
|
|
171
|
-
'\n',
|
|
172
|
-
),
|
|
173
|
-
|
|
174
|
-
InterfaceTypeDefinition: ({ description, name, directives, fields }) =>
|
|
113
|
+
ScalarTypeDefinition: addDescription(({ name, directives }) =>
|
|
114
|
+
join(['scalar', name, join(directives, ' ')], ' '),
|
|
115
|
+
),
|
|
116
|
+
|
|
117
|
+
ObjectTypeDefinition: addDescription(
|
|
118
|
+
({ name, interfaces, directives, fields }) =>
|
|
119
|
+
join(
|
|
120
|
+
[
|
|
121
|
+
'type',
|
|
122
|
+
name,
|
|
123
|
+
wrap('implements ', join(interfaces, ' & ')),
|
|
124
|
+
join(directives, ' '),
|
|
125
|
+
block(fields),
|
|
126
|
+
],
|
|
127
|
+
' ',
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
|
+
|
|
131
|
+
FieldDefinition: addDescription(
|
|
132
|
+
({ name, arguments: args, type, directives }) =>
|
|
133
|
+
name +
|
|
134
|
+
wrap('(', join(args, ', '), ')') +
|
|
135
|
+
': ' +
|
|
136
|
+
type +
|
|
137
|
+
wrap(' ', join(directives, ' ')),
|
|
138
|
+
),
|
|
139
|
+
|
|
140
|
+
InputValueDefinition: addDescription(
|
|
141
|
+
({ name, type, defaultValue, directives }) =>
|
|
142
|
+
join(
|
|
143
|
+
[name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],
|
|
144
|
+
' ',
|
|
145
|
+
),
|
|
146
|
+
),
|
|
147
|
+
|
|
148
|
+
InterfaceTypeDefinition: addDescription(({ name, directives, fields }) =>
|
|
149
|
+
join(['interface', name, join(directives, ' '), block(fields)], ' '),
|
|
150
|
+
),
|
|
151
|
+
|
|
152
|
+
UnionTypeDefinition: addDescription(({ name, directives, types }) =>
|
|
175
153
|
join(
|
|
176
154
|
[
|
|
177
|
-
|
|
178
|
-
|
|
155
|
+
'union',
|
|
156
|
+
name,
|
|
157
|
+
join(directives, ' '),
|
|
158
|
+
types && types.length !== 0 ? '= ' + join(types, ' | ') : '',
|
|
179
159
|
],
|
|
180
|
-
'
|
|
160
|
+
' ',
|
|
181
161
|
),
|
|
162
|
+
),
|
|
182
163
|
|
|
183
|
-
|
|
184
|
-
join(
|
|
185
|
-
|
|
186
|
-
description,
|
|
187
|
-
join(
|
|
188
|
-
[
|
|
189
|
-
'union',
|
|
190
|
-
name,
|
|
191
|
-
join(directives, ' '),
|
|
192
|
-
types && types.length !== 0 ? '= ' + join(types, ' | ') : '',
|
|
193
|
-
],
|
|
194
|
-
' ',
|
|
195
|
-
),
|
|
196
|
-
],
|
|
197
|
-
'\n',
|
|
198
|
-
),
|
|
164
|
+
EnumTypeDefinition: addDescription(({ name, directives, values }) =>
|
|
165
|
+
join(['enum', name, join(directives, ' '), block(values)], ' '),
|
|
166
|
+
),
|
|
199
167
|
|
|
200
|
-
|
|
201
|
-
join(
|
|
202
|
-
|
|
203
|
-
description,
|
|
204
|
-
join(['enum', name, join(directives, ' '), block(values)], ' '),
|
|
205
|
-
],
|
|
206
|
-
'\n',
|
|
207
|
-
),
|
|
168
|
+
EnumValueDefinition: addDescription(({ name, directives }) =>
|
|
169
|
+
join([name, join(directives, ' ')], ' '),
|
|
170
|
+
),
|
|
208
171
|
|
|
209
|
-
|
|
210
|
-
join([
|
|
211
|
-
|
|
212
|
-
InputObjectTypeDefinition: ({ description, name, directives, fields }) =>
|
|
213
|
-
join(
|
|
214
|
-
[
|
|
215
|
-
description,
|
|
216
|
-
join(['input', name, join(directives, ' '), block(fields)], ' '),
|
|
217
|
-
],
|
|
218
|
-
'\n',
|
|
219
|
-
),
|
|
172
|
+
InputObjectTypeDefinition: addDescription(({ name, directives, fields }) =>
|
|
173
|
+
join(['input', name, join(directives, ' '), block(fields)], ' '),
|
|
174
|
+
),
|
|
220
175
|
|
|
221
176
|
ScalarTypeExtension: ({ name, directives }) =>
|
|
222
177
|
join(['extend scalar', name, join(directives, ' ')], ' '),
|
|
@@ -226,7 +181,7 @@ const printDocASTReducer = {
|
|
|
226
181
|
[
|
|
227
182
|
'extend type',
|
|
228
183
|
name,
|
|
229
|
-
wrap('implements ', join(interfaces, '
|
|
184
|
+
wrap('implements ', join(interfaces, ' & ')),
|
|
230
185
|
join(directives, ' '),
|
|
231
186
|
block(fields),
|
|
232
187
|
],
|
|
@@ -253,20 +208,20 @@ const printDocASTReducer = {
|
|
|
253
208
|
InputObjectTypeExtension: ({ name, directives, fields }) =>
|
|
254
209
|
join(['extend input', name, join(directives, ' '), block(fields)], ' '),
|
|
255
210
|
|
|
256
|
-
DirectiveDefinition: (
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
join(locations, ' | '),
|
|
265
|
-
],
|
|
266
|
-
'\n',
|
|
267
|
-
),
|
|
211
|
+
DirectiveDefinition: addDescription(
|
|
212
|
+
({ name, arguments: args, locations }) =>
|
|
213
|
+
'directive @' +
|
|
214
|
+
name +
|
|
215
|
+
wrap('(', join(args, ', '), ')') +
|
|
216
|
+
' on ' +
|
|
217
|
+
join(locations, ' | '),
|
|
218
|
+
),
|
|
268
219
|
};
|
|
269
220
|
|
|
221
|
+
function addDescription(cb) {
|
|
222
|
+
return node => join([node.description, cb(node)], '\n');
|
|
223
|
+
}
|
|
224
|
+
|
|
270
225
|
/**
|
|
271
226
|
* Given maybeArray, print an empty string if it is null or empty, otherwise
|
|
272
227
|
* print all items together separated by separator if provided
|
|
@@ -281,7 +236,7 @@ function join(maybeArray, separator) {
|
|
|
281
236
|
*/
|
|
282
237
|
function block(array) {
|
|
283
238
|
return array && array.length !== 0
|
|
284
|
-
?
|
|
239
|
+
? '{\n' + indent(join(array, '\n')) + '\n}'
|
|
285
240
|
: '';
|
|
286
241
|
}
|
|
287
242
|
|
|
@@ -294,7 +249,7 @@ function wrap(start, maybeString, end) {
|
|
|
294
249
|
}
|
|
295
250
|
|
|
296
251
|
function indent(maybeString) {
|
|
297
|
-
return maybeString && maybeString.replace(/\n/g, '\n ');
|
|
252
|
+
return maybeString && ' ' + maybeString.replace(/\n/g, '\n ');
|
|
298
253
|
}
|
|
299
254
|
|
|
300
255
|
/**
|
|
@@ -303,9 +258,8 @@ function indent(maybeString) {
|
|
|
303
258
|
* a single-line, adding a leading blank line would strip that whitespace.
|
|
304
259
|
*/
|
|
305
260
|
function printBlockString(value, isDescription) {
|
|
261
|
+
const escaped = value.replace(/"""/g, '\\"""');
|
|
306
262
|
return (value[0] === ' ' || value[0] === '\t') && value.indexOf('\n') === -1
|
|
307
|
-
? `"""${
|
|
308
|
-
: isDescription
|
|
309
|
-
? '"""\n' + value.replace(/"""/g, '\\"""') + '\n"""'
|
|
310
|
-
: indent('"""\n' + value.replace(/"""/g, '\\"""')) + '\n"""';
|
|
263
|
+
? `"""${escaped.replace(/"$/, '"\n')}"""`
|
|
264
|
+
: `"""\n${isDescription ? escaped : indent(escaped)}\n"""`;
|
|
311
265
|
}
|
|
@@ -113,7 +113,7 @@ var printDocASTReducer = {
|
|
|
113
113
|
},
|
|
114
114
|
BooleanValue: function BooleanValue(_ref11) {
|
|
115
115
|
var value = _ref11.value;
|
|
116
|
-
return
|
|
116
|
+
return value ? 'true' : 'false';
|
|
117
117
|
},
|
|
118
118
|
NullValue: function NullValue() {
|
|
119
119
|
return 'null';
|
|
@@ -173,78 +173,69 @@ var printDocASTReducer = {
|
|
|
173
173
|
return operation + ': ' + type;
|
|
174
174
|
},
|
|
175
175
|
|
|
176
|
-
ScalarTypeDefinition: function
|
|
177
|
-
var
|
|
178
|
-
name = _ref22.name,
|
|
176
|
+
ScalarTypeDefinition: addDescription(function (_ref22) {
|
|
177
|
+
var name = _ref22.name,
|
|
179
178
|
directives = _ref22.directives;
|
|
180
|
-
return join([
|
|
181
|
-
},
|
|
179
|
+
return join(['scalar', name, join(directives, ' ')], ' ');
|
|
180
|
+
}),
|
|
182
181
|
|
|
183
|
-
ObjectTypeDefinition: function
|
|
184
|
-
var
|
|
185
|
-
name = _ref23.name,
|
|
182
|
+
ObjectTypeDefinition: addDescription(function (_ref23) {
|
|
183
|
+
var name = _ref23.name,
|
|
186
184
|
interfaces = _ref23.interfaces,
|
|
187
185
|
directives = _ref23.directives,
|
|
188
186
|
fields = _ref23.fields;
|
|
189
|
-
return join([
|
|
190
|
-
},
|
|
187
|
+
return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
|
|
188
|
+
}),
|
|
191
189
|
|
|
192
|
-
FieldDefinition: function
|
|
193
|
-
var
|
|
194
|
-
name = _ref24.name,
|
|
190
|
+
FieldDefinition: addDescription(function (_ref24) {
|
|
191
|
+
var name = _ref24.name,
|
|
195
192
|
args = _ref24.arguments,
|
|
196
193
|
type = _ref24.type,
|
|
197
194
|
directives = _ref24.directives;
|
|
198
|
-
return
|
|
199
|
-
},
|
|
195
|
+
return name + wrap('(', join(args, ', '), ')') + ': ' + type + wrap(' ', join(directives, ' '));
|
|
196
|
+
}),
|
|
200
197
|
|
|
201
|
-
InputValueDefinition: function
|
|
202
|
-
var
|
|
203
|
-
name = _ref25.name,
|
|
198
|
+
InputValueDefinition: addDescription(function (_ref25) {
|
|
199
|
+
var name = _ref25.name,
|
|
204
200
|
type = _ref25.type,
|
|
205
201
|
defaultValue = _ref25.defaultValue,
|
|
206
202
|
directives = _ref25.directives;
|
|
207
|
-
return join([
|
|
208
|
-
},
|
|
203
|
+
return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');
|
|
204
|
+
}),
|
|
209
205
|
|
|
210
|
-
InterfaceTypeDefinition: function
|
|
211
|
-
var
|
|
212
|
-
name = _ref26.name,
|
|
206
|
+
InterfaceTypeDefinition: addDescription(function (_ref26) {
|
|
207
|
+
var name = _ref26.name,
|
|
213
208
|
directives = _ref26.directives,
|
|
214
209
|
fields = _ref26.fields;
|
|
215
|
-
return join([
|
|
216
|
-
},
|
|
210
|
+
return join(['interface', name, join(directives, ' '), block(fields)], ' ');
|
|
211
|
+
}),
|
|
217
212
|
|
|
218
|
-
UnionTypeDefinition: function
|
|
219
|
-
var
|
|
220
|
-
name = _ref27.name,
|
|
213
|
+
UnionTypeDefinition: addDescription(function (_ref27) {
|
|
214
|
+
var name = _ref27.name,
|
|
221
215
|
directives = _ref27.directives,
|
|
222
216
|
types = _ref27.types;
|
|
223
|
-
return join([
|
|
224
|
-
},
|
|
217
|
+
return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');
|
|
218
|
+
}),
|
|
225
219
|
|
|
226
|
-
EnumTypeDefinition: function
|
|
227
|
-
var
|
|
228
|
-
name = _ref28.name,
|
|
220
|
+
EnumTypeDefinition: addDescription(function (_ref28) {
|
|
221
|
+
var name = _ref28.name,
|
|
229
222
|
directives = _ref28.directives,
|
|
230
223
|
values = _ref28.values;
|
|
231
|
-
return join([
|
|
232
|
-
},
|
|
224
|
+
return join(['enum', name, join(directives, ' '), block(values)], ' ');
|
|
225
|
+
}),
|
|
233
226
|
|
|
234
|
-
EnumValueDefinition: function
|
|
235
|
-
var
|
|
236
|
-
name = _ref29.name,
|
|
227
|
+
EnumValueDefinition: addDescription(function (_ref29) {
|
|
228
|
+
var name = _ref29.name,
|
|
237
229
|
directives = _ref29.directives;
|
|
238
|
-
return join([
|
|
239
|
-
},
|
|
230
|
+
return join([name, join(directives, ' ')], ' ');
|
|
231
|
+
}),
|
|
240
232
|
|
|
241
|
-
InputObjectTypeDefinition: function
|
|
242
|
-
var
|
|
243
|
-
name = _ref30.name,
|
|
233
|
+
InputObjectTypeDefinition: addDescription(function (_ref30) {
|
|
234
|
+
var name = _ref30.name,
|
|
244
235
|
directives = _ref30.directives,
|
|
245
236
|
fields = _ref30.fields;
|
|
246
|
-
return join([
|
|
247
|
-
},
|
|
237
|
+
return join(['input', name, join(directives, ' '), block(fields)], ' ');
|
|
238
|
+
}),
|
|
248
239
|
|
|
249
240
|
ScalarTypeExtension: function ScalarTypeExtension(_ref31) {
|
|
250
241
|
var name = _ref31.name,
|
|
@@ -257,7 +248,7 @@ var printDocASTReducer = {
|
|
|
257
248
|
interfaces = _ref32.interfaces,
|
|
258
249
|
directives = _ref32.directives,
|
|
259
250
|
fields = _ref32.fields;
|
|
260
|
-
return join(['extend type', name, wrap('implements ', join(interfaces, '
|
|
251
|
+
return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
|
|
261
252
|
},
|
|
262
253
|
|
|
263
254
|
InterfaceTypeExtension: function InterfaceTypeExtension(_ref33) {
|
|
@@ -288,15 +279,20 @@ var printDocASTReducer = {
|
|
|
288
279
|
return join(['extend input', name, join(directives, ' '), block(fields)], ' ');
|
|
289
280
|
},
|
|
290
281
|
|
|
291
|
-
DirectiveDefinition: function
|
|
292
|
-
var
|
|
293
|
-
name = _ref37.name,
|
|
282
|
+
DirectiveDefinition: addDescription(function (_ref37) {
|
|
283
|
+
var name = _ref37.name,
|
|
294
284
|
args = _ref37.arguments,
|
|
295
285
|
locations = _ref37.locations;
|
|
296
|
-
return
|
|
297
|
-
}
|
|
286
|
+
return 'directive @' + name + wrap('(', join(args, ', '), ')') + ' on ' + join(locations, ' | ');
|
|
287
|
+
})
|
|
298
288
|
};
|
|
299
289
|
|
|
290
|
+
function addDescription(cb) {
|
|
291
|
+
return function (node) {
|
|
292
|
+
return join([node.description, cb(node)], '\n');
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
300
296
|
/**
|
|
301
297
|
* Given maybeArray, print an empty string if it is null or empty, otherwise
|
|
302
298
|
* print all items together separated by separator if provided
|
|
@@ -312,7 +308,7 @@ function join(maybeArray, separator) {
|
|
|
312
308
|
* indented "{ }" block.
|
|
313
309
|
*/
|
|
314
310
|
function block(array) {
|
|
315
|
-
return array && array.length !== 0 ?
|
|
311
|
+
return array && array.length !== 0 ? '{\n' + indent(join(array, '\n')) + '\n}' : '';
|
|
316
312
|
}
|
|
317
313
|
|
|
318
314
|
/**
|
|
@@ -324,7 +320,7 @@ function wrap(start, maybeString, end) {
|
|
|
324
320
|
}
|
|
325
321
|
|
|
326
322
|
function indent(maybeString) {
|
|
327
|
-
return maybeString && maybeString.replace(/\n/g, '\n ');
|
|
323
|
+
return maybeString && ' ' + maybeString.replace(/\n/g, '\n ');
|
|
328
324
|
}
|
|
329
325
|
|
|
330
326
|
/**
|
|
@@ -333,5 +329,6 @@ function indent(maybeString) {
|
|
|
333
329
|
* a single-line, adding a leading blank line would strip that whitespace.
|
|
334
330
|
*/
|
|
335
331
|
function printBlockString(value, isDescription) {
|
|
336
|
-
|
|
332
|
+
var escaped = value.replace(/"""/g, '\\"""');
|
|
333
|
+
return (value[0] === ' ' || value[0] === '\t') && value.indexOf('\n') === -1 ? '"""' + escaped.replace(/"$/, '"\n') + '"""' : '"""\n' + (isDescription ? escaped : indent(escaped)) + '\n"""';
|
|
337
334
|
}
|
package/language/source.js
CHANGED
package/language/source.js.flow
CHANGED
|
@@ -6,7 +6,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* strict
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import invariant from '../jsutils/invariant';
|
package/language/visitor.js
CHANGED
package/language/visitor.js.flow
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "A Query Language and Runtime which can target any service.",
|
|
5
|
-
"contributors": [
|
|
6
|
-
"Lee Byron <lee@leebyron.com> (http://leebyron.com/)",
|
|
7
|
-
"Nicholas Schrock <schrockn@fb.com>",
|
|
8
|
-
"Daniel Schafer <dschafer@fb.com>"
|
|
9
|
-
],
|
|
10
5
|
"license": "MIT",
|
|
11
|
-
"main": "index
|
|
12
|
-
"module": "
|
|
6
|
+
"main": "index",
|
|
7
|
+
"module": "index.mjs",
|
|
13
8
|
"homepage": "https://github.com/graphql/graphql-js",
|
|
14
9
|
"bugs": {
|
|
15
10
|
"url": "https://github.com/graphql/graphql-js/issues"
|
|
@@ -19,6 +14,6 @@
|
|
|
19
14
|
"url": "http://github.com/graphql/graphql-js.git"
|
|
20
15
|
},
|
|
21
16
|
"dependencies": {
|
|
22
|
-
"iterall": "1.1
|
|
17
|
+
"iterall": "^1.2.1"
|
|
23
18
|
}
|
|
24
19
|
}
|
|
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* strict
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { $$asyncIterator } from 'iterall';
|
|
@@ -13,7 +13,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* strict
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -24,6 +24,7 @@ function mapAsyncIterator(iterable, callback, rejectCallback) {
|
|
|
24
24
|
var iterator = (0, _iterall.getAsyncIterator)(iterable);
|
|
25
25
|
var $return = void 0;
|
|
26
26
|
var abruptClose = void 0;
|
|
27
|
+
// $FlowFixMe(>=0.68.0)
|
|
27
28
|
if (typeof iterator.return === 'function') {
|
|
28
29
|
$return = iterator.return;
|
|
29
30
|
abruptClose = function abruptClose(error) {
|
|
@@ -57,6 +58,7 @@ function mapAsyncIterator(iterable, callback, rejectCallback) {
|
|
|
57
58
|
return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({ value: undefined, done: true });
|
|
58
59
|
},
|
|
59
60
|
throw: function _throw(error) {
|
|
61
|
+
// $FlowFixMe(>=0.68.0)
|
|
60
62
|
if (typeof iterator.throw === 'function') {
|
|
61
63
|
return iterator.throw(error).then(mapResult, mapReject);
|
|
62
64
|
}
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @flow
|
|
7
|
+
* @flow strict
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { $$asyncIterator, getAsyncIterator } from 'iterall';
|
|
11
|
+
import type { MaybePromise } from '../jsutils/MaybePromise';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Given an AsyncIterable and a callback function, return an AsyncIterator
|
|
@@ -15,12 +16,13 @@ import { $$asyncIterator, getAsyncIterator } from 'iterall';
|
|
|
15
16
|
*/
|
|
16
17
|
export default function mapAsyncIterator<T, U>(
|
|
17
18
|
iterable: AsyncIterable<T>,
|
|
18
|
-
callback: T =>
|
|
19
|
-
rejectCallback?: any =>
|
|
19
|
+
callback: T => MaybePromise<U>,
|
|
20
|
+
rejectCallback?: any => MaybePromise<U>,
|
|
20
21
|
): AsyncGenerator<U, void, void> {
|
|
21
22
|
const iterator = getAsyncIterator(iterable);
|
|
22
23
|
let $return;
|
|
23
24
|
let abruptClose;
|
|
25
|
+
// $FlowFixMe(>=0.68.0)
|
|
24
26
|
if (typeof iterator.return === 'function') {
|
|
25
27
|
$return = iterator.return;
|
|
26
28
|
abruptClose = error => {
|
|
@@ -55,6 +57,7 @@ export default function mapAsyncIterator<T, U>(
|
|
|
55
57
|
: Promise.resolve({ value: undefined, done: true });
|
|
56
58
|
},
|
|
57
59
|
throw(error) {
|
|
60
|
+
// $FlowFixMe(>=0.68.0)
|
|
58
61
|
if (typeof iterator.throw === 'function') {
|
|
59
62
|
return iterator.throw(error).then(mapResult, mapReject);
|
|
60
63
|
}
|
|
@@ -68,7 +71,7 @@ export default function mapAsyncIterator<T, U>(
|
|
|
68
71
|
|
|
69
72
|
function asyncMapValue<T, U>(
|
|
70
73
|
value: T,
|
|
71
|
-
callback: T =>
|
|
74
|
+
callback: T => MaybePromise<U>,
|
|
72
75
|
): Promise<U> {
|
|
73
76
|
return new Promise(resolve => resolve(callback(value)));
|
|
74
77
|
}
|