graphql 15.1.0 → 15.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +10 -12
- package/error/GraphQLError.js +5 -5
- package/error/GraphQLError.js.flow +5 -5
- package/error/GraphQLError.mjs +1 -1
- package/error/formatError.js +1 -1
- package/error/formatError.js.flow +2 -3
- package/error/index.js +4 -4
- package/error/index.js.flow +0 -1
- package/error/locatedError.d.ts +2 -2
- package/error/locatedError.js +10 -5
- package/error/locatedError.js.flow +11 -5
- package/error/locatedError.mjs +6 -4
- package/error/syntaxError.js +1 -1
- package/error/syntaxError.js.flow +1 -2
- package/execution/execute.d.ts +24 -16
- package/execution/execute.js +123 -105
- package/execution/execute.js.flow +169 -153
- package/execution/execute.mjs +101 -82
- package/execution/index.d.ts +2 -0
- package/execution/index.js +9 -3
- package/execution/index.js.flow +12 -3
- package/execution/index.mjs +1 -1
- package/execution/values.js +11 -11
- package/execution/values.js.flow +10 -14
- package/graphql.js +5 -5
- package/graphql.js.flow +9 -9
- package/index.d.ts +19 -1
- package/index.js +27 -9
- package/index.js.flow +10 -3
- package/index.mjs +4 -3
- package/jsutils/ObjMap.js.flow +0 -1
- package/jsutils/Path.d.ts +6 -1
- package/jsutils/Path.js +3 -2
- package/jsutils/Path.js.flow +3 -2
- package/jsutils/Path.mjs +3 -2
- package/jsutils/PromiseOrValue.js.flow +0 -1
- package/jsutils/defineInspect.js +2 -2
- package/jsutils/defineInspect.js.flow +0 -1
- package/jsutils/devAssert.js.flow +0 -1
- package/jsutils/didYouMean.js.flow +0 -1
- package/jsutils/identityFunc.js.flow +0 -1
- package/jsutils/inspect.js +1 -2
- package/jsutils/inspect.js.flow +10 -8
- package/jsutils/inspect.mjs +1 -1
- package/jsutils/instanceOf.js.flow +2 -3
- package/jsutils/invariant.js.flow +0 -1
- package/jsutils/isAsyncIterable.js +19 -0
- package/jsutils/isAsyncIterable.js.flow +18 -0
- package/jsutils/isAsyncIterable.mjs +16 -0
- package/jsutils/isCollection.js +1 -1
- package/jsutils/isCollection.js.flow +0 -1
- package/jsutils/isObjectLike.js.flow +0 -1
- package/jsutils/isPromise.js.flow +0 -1
- package/jsutils/keyMap.js.flow +1 -2
- package/jsutils/keyValMap.js.flow +1 -2
- package/jsutils/mapValue.js +1 -1
- package/jsutils/mapValue.js.flow +1 -2
- package/jsutils/memoize3.js +2 -5
- package/jsutils/memoize3.js.flow +2 -5
- package/jsutils/memoize3.mjs +2 -5
- package/jsutils/nodejsCustomInspectSymbol.js.flow +0 -1
- package/jsutils/printPathArray.js.flow +0 -1
- package/jsutils/promiseForObject.js.flow +1 -2
- package/jsutils/promiseReduce.js +1 -1
- package/jsutils/promiseReduce.js.flow +1 -1
- package/jsutils/promiseReduce.mjs +1 -1
- package/jsutils/suggestionList.js.flow +1 -2
- package/jsutils/toObjMap.js +1 -1
- package/jsutils/toObjMap.js.flow +5 -6
- package/language/ast.js +1 -1
- package/language/ast.js.flow +2 -3
- package/language/blockString.d.ts +1 -1
- package/language/blockString.js +53 -32
- package/language/blockString.js.flow +49 -34
- package/language/blockString.mjs +54 -33
- package/language/directiveLocation.js.flow +0 -1
- package/language/experimentalOnlineParser/grammar.d.ts +1006 -0
- package/language/experimentalOnlineParser/grammar.js +987 -0
- package/language/experimentalOnlineParser/grammar.js.flow +1000 -0
- package/language/experimentalOnlineParser/grammar.mjs +980 -0
- package/language/experimentalOnlineParser/index.d.ts +6 -0
- package/language/experimentalOnlineParser/index.js +31 -0
- package/language/experimentalOnlineParser/index.js.flow +7 -0
- package/language/experimentalOnlineParser/index.mjs +1 -0
- package/language/experimentalOnlineParser/onlineParser.d.ts +125 -0
- package/language/experimentalOnlineParser/onlineParser.js +604 -0
- package/language/experimentalOnlineParser/onlineParser.js.flow +723 -0
- package/language/experimentalOnlineParser/onlineParser.mjs +587 -0
- package/language/index.js +12 -12
- package/language/index.js.flow +0 -1
- package/language/kinds.js.flow +0 -1
- package/language/lexer.js +242 -183
- package/language/lexer.js.flow +191 -186
- package/language/lexer.mjs +239 -180
- package/language/location.js.flow +1 -2
- package/language/parser.js +73 -68
- package/language/parser.js.flow +112 -106
- package/language/parser.mjs +66 -62
- package/language/predicates.js +1 -1
- package/language/predicates.js.flow +1 -2
- package/language/printLocation.js +1 -1
- package/language/printLocation.js.flow +4 -4
- package/language/printer.js +20 -13
- package/language/printer.js.flow +27 -25
- package/language/printer.mjs +18 -11
- package/language/source.d.ts +12 -6
- package/language/source.js +25 -9
- package/language/source.js.flow +25 -8
- package/language/source.mjs +19 -7
- package/language/tokenKind.js.flow +0 -1
- package/language/visitor.d.ts +3 -3
- package/language/visitor.js +5 -5
- package/language/visitor.js.flow +5 -5
- package/language/visitor.mjs +3 -3
- package/package.json +1 -1
- package/polyfills/arrayFrom.js +2 -2
- package/polyfills/arrayFrom.js.flow +1 -2
- package/polyfills/arrayFrom.mjs +1 -1
- package/polyfills/find.js +1 -1
- package/polyfills/find.js.flow +1 -2
- package/polyfills/find.mjs +1 -1
- package/polyfills/isFinite.js +1 -1
- package/polyfills/isFinite.js.flow +1 -2
- package/polyfills/isFinite.mjs +1 -1
- package/polyfills/isInteger.js +1 -1
- package/polyfills/isInteger.js.flow +1 -2
- package/polyfills/isInteger.mjs +1 -1
- package/polyfills/objectEntries.js +1 -1
- package/polyfills/objectEntries.js.flow +2 -3
- package/polyfills/objectEntries.mjs +1 -1
- package/polyfills/objectValues.js +1 -1
- package/polyfills/objectValues.js.flow +2 -3
- package/polyfills/objectValues.mjs +1 -1
- package/polyfills/symbols.js +3 -5
- package/polyfills/symbols.js.flow +9 -6
- package/polyfills/symbols.mjs +3 -5
- package/subscription/index.js +1 -1
- package/subscription/index.js.flow +0 -1
- package/subscription/mapAsyncIterator.js +2 -2
- package/subscription/mapAsyncIterator.js.flow +9 -10
- package/subscription/mapAsyncIterator.mjs +1 -1
- package/subscription/subscribe.js +61 -73
- package/subscription/subscribe.js.flow +74 -88
- package/subscription/subscribe.mjs +53 -65
- package/type/definition.d.ts +181 -31
- package/type/definition.js +37 -32
- package/type/definition.js.flow +66 -51
- package/type/definition.mjs +20 -18
- package/type/directives.d.ts +17 -3
- package/type/directives.js +17 -16
- package/type/directives.js.flow +20 -21
- package/type/directives.mjs +6 -5
- package/type/index.d.ts +12 -0
- package/type/index.js +6 -6
- package/type/index.js.flow +0 -1
- package/type/introspection.js +86 -68
- package/type/introspection.js.flow +85 -54
- package/type/introspection.mjs +79 -61
- package/type/scalars.js +9 -9
- package/type/scalars.js.flow +3 -3
- package/type/scalars.mjs +1 -1
- package/type/schema.d.ts +17 -4
- package/type/schema.js +13 -13
- package/type/schema.js.flow +18 -16
- package/type/schema.mjs +1 -1
- package/type/validate.js +52 -19
- package/type/validate.js.flow +67 -18
- package/type/validate.mjs +44 -10
- package/utilities/TypeInfo.js +7 -7
- package/utilities/TypeInfo.js.flow +16 -18
- package/utilities/TypeInfo.mjs +1 -1
- package/utilities/assertValidName.js +2 -2
- package/utilities/assertValidName.js.flow +0 -1
- package/utilities/astFromValue.js +10 -10
- package/utilities/astFromValue.js.flow +2 -3
- package/utilities/buildASTSchema.js +17 -27
- package/utilities/buildASTSchema.js.flow +11 -28
- package/utilities/buildASTSchema.mjs +11 -21
- package/utilities/buildClientSchema.js +14 -14
- package/utilities/buildClientSchema.js.flow +41 -29
- package/utilities/buildClientSchema.mjs +5 -5
- package/utilities/coerceInputValue.js +14 -14
- package/utilities/coerceInputValue.js.flow +7 -6
- package/utilities/coerceInputValue.mjs +2 -2
- package/utilities/concatAST.js +9 -8
- package/utilities/concatAST.js.flow +9 -9
- package/utilities/concatAST.mjs +9 -6
- package/utilities/extendSchema.js +26 -19
- package/utilities/extendSchema.js.flow +58 -45
- package/utilities/extendSchema.mjs +9 -2
- package/utilities/findBreakingChanges.js +9 -9
- package/utilities/findBreakingChanges.js.flow +12 -11
- package/utilities/findDeprecatedUsages.d.ts +9 -1
- package/utilities/findDeprecatedUsages.js +11 -27
- package/utilities/findDeprecatedUsages.js.flow +15 -44
- package/utilities/findDeprecatedUsages.mjs +11 -25
- package/utilities/getIntrospectionQuery.js.flow +2 -3
- package/utilities/getOperationAST.js +1 -1
- package/utilities/getOperationAST.js.flow +1 -5
- package/utilities/getOperationAST.mjs +1 -1
- package/utilities/getOperationRootType.js +1 -1
- package/utilities/getOperationRootType.js.flow +5 -6
- package/utilities/index.d.ts +4 -1
- package/utilities/index.js +22 -22
- package/utilities/index.js.flow +1 -2
- package/utilities/index.mjs +1 -1
- package/utilities/introspectionFromSchema.js +6 -8
- package/utilities/introspectionFromSchema.js.flow +10 -10
- package/utilities/introspectionFromSchema.mjs +3 -4
- package/utilities/lexicographicSortSchema.js +10 -8
- package/utilities/lexicographicSortSchema.js.flow +19 -12
- package/utilities/lexicographicSortSchema.mjs +3 -1
- package/utilities/printSchema.js +15 -16
- package/utilities/printSchema.js.flow +34 -25
- package/utilities/printSchema.mjs +6 -7
- package/utilities/separateOperations.js +2 -2
- package/utilities/separateOperations.js.flow +2 -6
- package/utilities/separateOperations.mjs +1 -1
- package/utilities/stripIgnoredCharacters.js +6 -16
- package/utilities/stripIgnoredCharacters.js.flow +4 -13
- package/utilities/stripIgnoredCharacters.mjs +3 -10
- package/utilities/typeComparators.js +1 -1
- package/utilities/typeComparators.js.flow +2 -4
- package/utilities/typeFromAST.js +6 -6
- package/utilities/typeFromAST.js.flow +11 -14
- package/utilities/typeFromAST.mjs +2 -2
- package/utilities/typedQueryDocumentNode.d.ts +20 -0
- package/utilities/valueFromAST.js +6 -6
- package/utilities/valueFromAST.js.flow +7 -5
- package/utilities/valueFromASTUntyped.js +4 -4
- package/utilities/valueFromASTUntyped.js.flow +2 -3
- package/validation/ValidationContext.d.ts +3 -0
- package/validation/ValidationContext.js +7 -3
- package/validation/ValidationContext.js.flow +28 -22
- package/validation/ValidationContext.mjs +4 -0
- package/validation/index.d.ts +4 -0
- package/validation/index.js +52 -36
- package/validation/index.js.flow +4 -1
- package/validation/index.mjs +4 -1
- package/validation/rules/ExecutableDefinitions.js +1 -1
- package/validation/rules/ExecutableDefinitions.js.flow +0 -1
- package/validation/rules/ExecutableDefinitionsRule.js +3 -3
- package/validation/rules/ExecutableDefinitionsRule.js.flow +2 -3
- package/validation/rules/FieldsOnCorrectTypeRule.js +5 -5
- package/validation/rules/FieldsOnCorrectTypeRule.js.flow +9 -8
- package/validation/rules/FragmentsOnCompositeTypesRule.js +4 -4
- package/validation/rules/FragmentsOnCompositeTypesRule.js.flow +2 -3
- package/validation/rules/KnownArgumentNamesRule.js +5 -5
- package/validation/rules/KnownArgumentNamesRule.js.flow +5 -5
- package/validation/rules/KnownDirectivesRule.js +6 -6
- package/validation/rules/KnownDirectivesRule.js.flow +10 -11
- package/validation/rules/KnownFragmentNamesRule.js +1 -1
- package/validation/rules/KnownFragmentNamesRule.js.flow +3 -3
- package/validation/rules/KnownTypeNamesRule.js +12 -10
- package/validation/rules/KnownTypeNamesRule.js.flow +14 -11
- package/validation/rules/KnownTypeNamesRule.mjs +6 -5
- package/validation/rules/LoneAnonymousOperationRule.js +2 -2
- package/validation/rules/LoneAnonymousOperationRule.js.flow +2 -3
- package/validation/rules/LoneSchemaDefinition.js +1 -1
- package/validation/rules/LoneSchemaDefinition.js.flow +0 -1
- package/validation/rules/LoneSchemaDefinitionRule.js +1 -1
- package/validation/rules/LoneSchemaDefinitionRule.js.flow +2 -3
- package/validation/rules/NoFragmentCyclesRule.js +1 -1
- package/validation/rules/NoFragmentCyclesRule.js.flow +4 -5
- package/validation/rules/NoUndefinedVariablesRule.js +1 -1
- package/validation/rules/NoUndefinedVariablesRule.js.flow +3 -3
- package/validation/rules/NoUnusedFragmentsRule.js +1 -1
- package/validation/rules/NoUnusedFragmentsRule.js.flow +3 -3
- package/validation/rules/NoUnusedVariablesRule.js +1 -1
- package/validation/rules/NoUnusedVariablesRule.js.flow +3 -3
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js +20 -20
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js.flow +29 -27
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +12 -12
- package/validation/rules/PossibleFragmentSpreadsRule.js +5 -5
- package/validation/rules/PossibleFragmentSpreadsRule.js.flow +7 -4
- package/validation/rules/PossibleTypeExtensions.js +1 -1
- package/validation/rules/PossibleTypeExtensions.js.flow +0 -1
- package/validation/rules/PossibleTypeExtensionsRule.js +8 -8
- package/validation/rules/PossibleTypeExtensionsRule.js.flow +8 -6
- package/validation/rules/ProvidedRequiredArgumentsRule.js +7 -7
- package/validation/rules/ProvidedRequiredArgumentsRule.js.flow +7 -6
- package/validation/rules/ScalarLeafsRule.js +3 -3
- package/validation/rules/ScalarLeafsRule.js.flow +3 -4
- package/validation/rules/SingleFieldSubscriptionsRule.js +1 -1
- package/validation/rules/SingleFieldSubscriptionsRule.js.flow +3 -4
- package/validation/rules/UniqueArgumentNamesRule.js +1 -1
- package/validation/rules/UniqueArgumentNamesRule.js.flow +2 -3
- package/validation/rules/UniqueDirectiveNames.js +1 -1
- package/validation/rules/UniqueDirectiveNames.js.flow +0 -1
- package/validation/rules/UniqueDirectiveNamesRule.js +1 -1
- package/validation/rules/UniqueDirectiveNamesRule.js.flow +2 -3
- package/validation/rules/UniqueDirectivesPerLocationRule.js +4 -4
- package/validation/rules/UniqueDirectivesPerLocationRule.js.flow +4 -5
- package/validation/rules/UniqueEnumValueNames.js +1 -1
- package/validation/rules/UniqueEnumValueNames.js.flow +0 -1
- package/validation/rules/UniqueEnumValueNamesRule.js +2 -2
- package/validation/rules/UniqueEnumValueNamesRule.js.flow +11 -4
- package/validation/rules/UniqueFieldDefinitionNames.js +1 -1
- package/validation/rules/UniqueFieldDefinitionNames.js.flow +0 -1
- package/validation/rules/UniqueFieldDefinitionNamesRule.js +3 -3
- package/validation/rules/UniqueFieldDefinitionNamesRule.js.flow +17 -6
- package/validation/rules/UniqueFieldDefinitionNamesRule.mjs +1 -1
- package/validation/rules/UniqueFragmentNamesRule.js +1 -1
- package/validation/rules/UniqueFragmentNamesRule.js.flow +3 -3
- package/validation/rules/UniqueInputFieldNamesRule.js +1 -1
- package/validation/rules/UniqueInputFieldNamesRule.js.flow +3 -3
- package/validation/rules/UniqueOperationNamesRule.js +1 -1
- package/validation/rules/UniqueOperationNamesRule.js.flow +3 -3
- package/validation/rules/UniqueOperationTypes.js +1 -1
- package/validation/rules/UniqueOperationTypes.js.flow +0 -1
- package/validation/rules/UniqueOperationTypesRule.js +1 -1
- package/validation/rules/UniqueOperationTypesRule.js.flow +10 -4
- package/validation/rules/UniqueTypeNames.js +1 -1
- package/validation/rules/UniqueTypeNames.js.flow +0 -1
- package/validation/rules/UniqueTypeNamesRule.js +1 -1
- package/validation/rules/UniqueTypeNamesRule.js.flow +3 -4
- package/validation/rules/UniqueVariableNamesRule.js +1 -1
- package/validation/rules/UniqueVariableNamesRule.js.flow +3 -4
- package/validation/rules/ValuesOfCorrectTypeRule.js +8 -8
- package/validation/rules/ValuesOfCorrectTypeRule.js.flow +3 -4
- package/validation/rules/VariablesAreInputTypesRule.js +4 -4
- package/validation/rules/VariablesAreInputTypesRule.js.flow +3 -4
- package/validation/rules/VariablesInAllowedPositionRule.js +6 -6
- package/validation/rules/VariablesInAllowedPositionRule.js.flow +6 -6
- package/validation/rules/custom/NoDeprecatedCustomRule.d.ts +14 -0
- package/validation/rules/custom/NoDeprecatedCustomRule.js +79 -0
- package/validation/rules/custom/NoDeprecatedCustomRule.js.flow +94 -0
- package/validation/rules/custom/NoDeprecatedCustomRule.mjs +68 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +16 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +34 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.flow +38 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +25 -0
- package/validation/specifiedRules.js +33 -33
- package/validation/specifiedRules.js.flow +0 -1
- package/validation/validate.js +7 -7
- package/validation/validate.js.flow +4 -9
- package/version.js +2 -2
- package/version.js.flow +2 -3
- package/version.mjs +2 -2
- package/polyfills/flatMap.js +0 -30
- package/polyfills/flatMap.js.flow +0 -28
- package/polyfills/flatMap.mjs +0 -23
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
// @flow strict
|
|
2
|
-
|
|
3
|
-
// FIXME
|
|
4
|
-
/* eslint-disable import/no-cycle */
|
|
5
|
-
|
|
6
2
|
import objectValues from '../polyfills/objectValues';
|
|
7
3
|
|
|
8
4
|
import inspect from '../jsutils/inspect';
|
|
@@ -12,20 +8,22 @@ import { print } from '../language/printer';
|
|
|
12
8
|
import { DirectiveLocation } from '../language/directiveLocation';
|
|
13
9
|
import { astFromValue } from '../utilities/astFromValue';
|
|
14
10
|
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
11
|
+
import type { GraphQLSchema } from './schema';
|
|
12
|
+
import type { GraphQLDirective } from './directives';
|
|
13
|
+
import type {
|
|
14
|
+
GraphQLType,
|
|
15
|
+
GraphQLNamedType,
|
|
16
|
+
GraphQLInputField,
|
|
17
|
+
GraphQLEnumValue,
|
|
18
|
+
GraphQLField,
|
|
19
|
+
GraphQLFieldConfigMap,
|
|
20
|
+
} from './definition';
|
|
17
21
|
import { GraphQLString, GraphQLBoolean } from './scalars';
|
|
18
22
|
import {
|
|
19
|
-
type GraphQLType,
|
|
20
|
-
type GraphQLNamedType,
|
|
21
|
-
type GraphQLInputField,
|
|
22
|
-
type GraphQLEnumValue,
|
|
23
|
-
type GraphQLField,
|
|
24
|
-
type GraphQLFieldConfigMap,
|
|
25
|
-
GraphQLObjectType,
|
|
26
|
-
GraphQLEnumType,
|
|
27
23
|
GraphQLList,
|
|
28
24
|
GraphQLNonNull,
|
|
25
|
+
GraphQLObjectType,
|
|
26
|
+
GraphQLEnumType,
|
|
29
27
|
isScalarType,
|
|
30
28
|
isObjectType,
|
|
31
29
|
isInterfaceType,
|
|
@@ -49,14 +47,14 @@ export const __Schema = new GraphQLObjectType({
|
|
|
49
47
|
},
|
|
50
48
|
types: {
|
|
51
49
|
description: 'A list of all types supported by this server.',
|
|
52
|
-
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type))),
|
|
50
|
+
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),
|
|
53
51
|
resolve(schema) {
|
|
54
52
|
return objectValues(schema.getTypeMap());
|
|
55
53
|
},
|
|
56
54
|
},
|
|
57
55
|
queryType: {
|
|
58
56
|
description: 'The type that query operations will be rooted at.',
|
|
59
|
-
type: GraphQLNonNull(__Type),
|
|
57
|
+
type: new GraphQLNonNull(__Type),
|
|
60
58
|
resolve: (schema) => schema.getQueryType(),
|
|
61
59
|
},
|
|
62
60
|
mutationType: {
|
|
@@ -73,7 +71,9 @@ export const __Schema = new GraphQLObjectType({
|
|
|
73
71
|
},
|
|
74
72
|
directives: {
|
|
75
73
|
description: 'A list of all directives supported by this server.',
|
|
76
|
-
type: GraphQLNonNull(
|
|
74
|
+
type: new GraphQLNonNull(
|
|
75
|
+
new GraphQLList(new GraphQLNonNull(__Directive)),
|
|
76
|
+
),
|
|
77
77
|
resolve: (schema) => schema.getDirectives(),
|
|
78
78
|
},
|
|
79
79
|
}: GraphQLFieldConfigMap<GraphQLSchema, mixed>),
|
|
@@ -86,7 +86,7 @@ export const __Directive = new GraphQLObjectType({
|
|
|
86
86
|
fields: () =>
|
|
87
87
|
({
|
|
88
88
|
name: {
|
|
89
|
-
type: GraphQLNonNull(GraphQLString),
|
|
89
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
90
90
|
resolve: (directive) => directive.name,
|
|
91
91
|
},
|
|
92
92
|
description: {
|
|
@@ -94,15 +94,19 @@ export const __Directive = new GraphQLObjectType({
|
|
|
94
94
|
resolve: (directive) => directive.description,
|
|
95
95
|
},
|
|
96
96
|
isRepeatable: {
|
|
97
|
-
type: GraphQLNonNull(GraphQLBoolean),
|
|
97
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
98
98
|
resolve: (directive) => directive.isRepeatable,
|
|
99
99
|
},
|
|
100
100
|
locations: {
|
|
101
|
-
type: GraphQLNonNull(
|
|
101
|
+
type: new GraphQLNonNull(
|
|
102
|
+
new GraphQLList(new GraphQLNonNull(__DirectiveLocation)),
|
|
103
|
+
),
|
|
102
104
|
resolve: (directive) => directive.locations,
|
|
103
105
|
},
|
|
104
106
|
args: {
|
|
105
|
-
type: GraphQLNonNull(
|
|
107
|
+
type: new GraphQLNonNull(
|
|
108
|
+
new GraphQLList(new GraphQLNonNull(__InputValue)),
|
|
109
|
+
),
|
|
106
110
|
resolve: (directive) => directive.args,
|
|
107
111
|
},
|
|
108
112
|
}: GraphQLFieldConfigMap<GraphQLDirective, mixed>),
|
|
@@ -199,7 +203,7 @@ export const __Type = new GraphQLObjectType({
|
|
|
199
203
|
fields: () =>
|
|
200
204
|
({
|
|
201
205
|
kind: {
|
|
202
|
-
type: GraphQLNonNull(__TypeKind),
|
|
206
|
+
type: new GraphQLNonNull(__TypeKind),
|
|
203
207
|
resolve(type) {
|
|
204
208
|
if (isScalarType(type)) {
|
|
205
209
|
return TypeKind.SCALAR;
|
|
@@ -246,23 +250,21 @@ export const __Type = new GraphQLObjectType({
|
|
|
246
250
|
obj.specifiedByUrl !== undefined ? obj.specifiedByUrl : undefined,
|
|
247
251
|
},
|
|
248
252
|
fields: {
|
|
249
|
-
type: GraphQLList(GraphQLNonNull(__Field)),
|
|
253
|
+
type: new GraphQLList(new GraphQLNonNull(__Field)),
|
|
250
254
|
args: {
|
|
251
255
|
includeDeprecated: { type: GraphQLBoolean, defaultValue: false },
|
|
252
256
|
},
|
|
253
257
|
resolve(type, { includeDeprecated }) {
|
|
254
258
|
if (isObjectType(type) || isInterfaceType(type)) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return fields;
|
|
259
|
+
const fields = objectValues(type.getFields());
|
|
260
|
+
return includeDeprecated
|
|
261
|
+
? fields
|
|
262
|
+
: fields.filter((field) => field.deprecationReason == null);
|
|
260
263
|
}
|
|
261
|
-
return null;
|
|
262
264
|
},
|
|
263
265
|
},
|
|
264
266
|
interfaces: {
|
|
265
|
-
type: GraphQLList(GraphQLNonNull(__Type)),
|
|
267
|
+
type: new GraphQLList(new GraphQLNonNull(__Type)),
|
|
266
268
|
resolve(type) {
|
|
267
269
|
if (isObjectType(type) || isInterfaceType(type)) {
|
|
268
270
|
return type.getInterfaces();
|
|
@@ -270,7 +272,7 @@ export const __Type = new GraphQLObjectType({
|
|
|
270
272
|
},
|
|
271
273
|
},
|
|
272
274
|
possibleTypes: {
|
|
273
|
-
type: GraphQLList(GraphQLNonNull(__Type)),
|
|
275
|
+
type: new GraphQLList(new GraphQLNonNull(__Type)),
|
|
274
276
|
resolve(type, _args, _context, { schema }) {
|
|
275
277
|
if (isAbstractType(type)) {
|
|
276
278
|
return schema.getPossibleTypes(type);
|
|
@@ -278,25 +280,33 @@ export const __Type = new GraphQLObjectType({
|
|
|
278
280
|
},
|
|
279
281
|
},
|
|
280
282
|
enumValues: {
|
|
281
|
-
type: GraphQLList(GraphQLNonNull(__EnumValue)),
|
|
283
|
+
type: new GraphQLList(new GraphQLNonNull(__EnumValue)),
|
|
282
284
|
args: {
|
|
283
285
|
includeDeprecated: { type: GraphQLBoolean, defaultValue: false },
|
|
284
286
|
},
|
|
285
287
|
resolve(type, { includeDeprecated }) {
|
|
286
288
|
if (isEnumType(type)) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return values;
|
|
289
|
+
const values = type.getValues();
|
|
290
|
+
return includeDeprecated
|
|
291
|
+
? values
|
|
292
|
+
: values.filter((field) => field.deprecationReason == null);
|
|
292
293
|
}
|
|
293
294
|
},
|
|
294
295
|
},
|
|
295
296
|
inputFields: {
|
|
296
|
-
type: GraphQLList(GraphQLNonNull(__InputValue)),
|
|
297
|
-
|
|
297
|
+
type: new GraphQLList(new GraphQLNonNull(__InputValue)),
|
|
298
|
+
args: {
|
|
299
|
+
includeDeprecated: {
|
|
300
|
+
type: GraphQLBoolean,
|
|
301
|
+
defaultValue: false,
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
resolve(type, { includeDeprecated }) {
|
|
298
305
|
if (isInputObjectType(type)) {
|
|
299
|
-
|
|
306
|
+
const values = objectValues(type.getFields());
|
|
307
|
+
return includeDeprecated
|
|
308
|
+
? values
|
|
309
|
+
: values.filter((field) => field.deprecationReason == null);
|
|
300
310
|
}
|
|
301
311
|
},
|
|
302
312
|
},
|
|
@@ -315,7 +325,7 @@ export const __Field = new GraphQLObjectType({
|
|
|
315
325
|
fields: () =>
|
|
316
326
|
({
|
|
317
327
|
name: {
|
|
318
|
-
type: GraphQLNonNull(GraphQLString),
|
|
328
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
319
329
|
resolve: (field) => field.name,
|
|
320
330
|
},
|
|
321
331
|
description: {
|
|
@@ -323,16 +333,28 @@ export const __Field = new GraphQLObjectType({
|
|
|
323
333
|
resolve: (field) => field.description,
|
|
324
334
|
},
|
|
325
335
|
args: {
|
|
326
|
-
type: GraphQLNonNull(
|
|
327
|
-
|
|
336
|
+
type: new GraphQLNonNull(
|
|
337
|
+
new GraphQLList(new GraphQLNonNull(__InputValue)),
|
|
338
|
+
),
|
|
339
|
+
args: {
|
|
340
|
+
includeDeprecated: {
|
|
341
|
+
type: GraphQLBoolean,
|
|
342
|
+
defaultValue: false,
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
resolve(field, { includeDeprecated }) {
|
|
346
|
+
return includeDeprecated
|
|
347
|
+
? field.args
|
|
348
|
+
: field.args.filter((arg) => arg.deprecationReason == null);
|
|
349
|
+
},
|
|
328
350
|
},
|
|
329
351
|
type: {
|
|
330
|
-
type: GraphQLNonNull(__Type),
|
|
352
|
+
type: new GraphQLNonNull(__Type),
|
|
331
353
|
resolve: (field) => field.type,
|
|
332
354
|
},
|
|
333
355
|
isDeprecated: {
|
|
334
|
-
type: GraphQLNonNull(GraphQLBoolean),
|
|
335
|
-
resolve: (field) => field.
|
|
356
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
357
|
+
resolve: (field) => field.deprecationReason != null,
|
|
336
358
|
},
|
|
337
359
|
deprecationReason: {
|
|
338
360
|
type: GraphQLString,
|
|
@@ -348,7 +370,7 @@ export const __InputValue = new GraphQLObjectType({
|
|
|
348
370
|
fields: () =>
|
|
349
371
|
({
|
|
350
372
|
name: {
|
|
351
|
-
type: GraphQLNonNull(GraphQLString),
|
|
373
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
352
374
|
resolve: (inputValue) => inputValue.name,
|
|
353
375
|
},
|
|
354
376
|
description: {
|
|
@@ -356,7 +378,7 @@ export const __InputValue = new GraphQLObjectType({
|
|
|
356
378
|
resolve: (inputValue) => inputValue.description,
|
|
357
379
|
},
|
|
358
380
|
type: {
|
|
359
|
-
type: GraphQLNonNull(__Type),
|
|
381
|
+
type: new GraphQLNonNull(__Type),
|
|
360
382
|
resolve: (inputValue) => inputValue.type,
|
|
361
383
|
},
|
|
362
384
|
defaultValue: {
|
|
@@ -369,6 +391,14 @@ export const __InputValue = new GraphQLObjectType({
|
|
|
369
391
|
return valueAST ? print(valueAST) : null;
|
|
370
392
|
},
|
|
371
393
|
},
|
|
394
|
+
isDeprecated: {
|
|
395
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
396
|
+
resolve: (field) => field.deprecationReason != null,
|
|
397
|
+
},
|
|
398
|
+
deprecationReason: {
|
|
399
|
+
type: GraphQLString,
|
|
400
|
+
resolve: (obj) => obj.deprecationReason,
|
|
401
|
+
},
|
|
372
402
|
}: GraphQLFieldConfigMap<GraphQLInputField, mixed>),
|
|
373
403
|
});
|
|
374
404
|
|
|
@@ -379,7 +409,7 @@ export const __EnumValue = new GraphQLObjectType({
|
|
|
379
409
|
fields: () =>
|
|
380
410
|
({
|
|
381
411
|
name: {
|
|
382
|
-
type: GraphQLNonNull(GraphQLString),
|
|
412
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
383
413
|
resolve: (enumValue) => enumValue.name,
|
|
384
414
|
},
|
|
385
415
|
description: {
|
|
@@ -387,8 +417,8 @@ export const __EnumValue = new GraphQLObjectType({
|
|
|
387
417
|
resolve: (enumValue) => enumValue.description,
|
|
388
418
|
},
|
|
389
419
|
isDeprecated: {
|
|
390
|
-
type: GraphQLNonNull(GraphQLBoolean),
|
|
391
|
-
resolve: (enumValue) => enumValue.
|
|
420
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
421
|
+
resolve: (enumValue) => enumValue.deprecationReason != null,
|
|
392
422
|
},
|
|
393
423
|
deprecationReason: {
|
|
394
424
|
type: GraphQLString,
|
|
@@ -460,7 +490,7 @@ export const __TypeKind = new GraphQLEnumType({
|
|
|
460
490
|
|
|
461
491
|
export const SchemaMetaFieldDef: GraphQLField<mixed, mixed> = {
|
|
462
492
|
name: '__schema',
|
|
463
|
-
type: GraphQLNonNull(__Schema),
|
|
493
|
+
type: new GraphQLNonNull(__Schema),
|
|
464
494
|
description: 'Access the current type schema of this server.',
|
|
465
495
|
args: [],
|
|
466
496
|
resolve: (_source, _args, _context, { schema }) => schema,
|
|
@@ -478,8 +508,9 @@ export const TypeMetaFieldDef: GraphQLField<mixed, mixed> = {
|
|
|
478
508
|
{
|
|
479
509
|
name: 'name',
|
|
480
510
|
description: undefined,
|
|
481
|
-
type: GraphQLNonNull(GraphQLString),
|
|
511
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
482
512
|
defaultValue: undefined,
|
|
513
|
+
deprecationReason: undefined,
|
|
483
514
|
extensions: undefined,
|
|
484
515
|
astNode: undefined,
|
|
485
516
|
},
|
|
@@ -493,7 +524,7 @@ export const TypeMetaFieldDef: GraphQLField<mixed, mixed> = {
|
|
|
493
524
|
|
|
494
525
|
export const TypeNameMetaFieldDef: GraphQLField<mixed, mixed> = {
|
|
495
526
|
name: '__typename',
|
|
496
|
-
type: GraphQLNonNull(GraphQLString),
|
|
527
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
497
528
|
description: 'The name of the current Object type at runtime.',
|
|
498
529
|
args: [],
|
|
499
530
|
resolve: (_source, _args, _context, { parentType }) => parentType.name,
|
package/type/introspection.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// FIXME
|
|
2
|
-
|
|
3
|
-
/* eslint-disable import/no-cycle */
|
|
4
1
|
import objectValues from "../polyfills/objectValues.mjs";
|
|
5
2
|
import inspect from "../jsutils/inspect.mjs";
|
|
6
3
|
import invariant from "../jsutils/invariant.mjs";
|
|
@@ -8,7 +5,7 @@ import { print } from "../language/printer.mjs";
|
|
|
8
5
|
import { DirectiveLocation } from "../language/directiveLocation.mjs";
|
|
9
6
|
import { astFromValue } from "../utilities/astFromValue.mjs";
|
|
10
7
|
import { GraphQLString, GraphQLBoolean } from "./scalars.mjs";
|
|
11
|
-
import {
|
|
8
|
+
import { GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLEnumType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isAbstractType } from "./definition.mjs";
|
|
12
9
|
export var __Schema = new GraphQLObjectType({
|
|
13
10
|
name: '__Schema',
|
|
14
11
|
description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.',
|
|
@@ -22,14 +19,14 @@ export var __Schema = new GraphQLObjectType({
|
|
|
22
19
|
},
|
|
23
20
|
types: {
|
|
24
21
|
description: 'A list of all types supported by this server.',
|
|
25
|
-
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type))),
|
|
22
|
+
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),
|
|
26
23
|
resolve: function resolve(schema) {
|
|
27
24
|
return objectValues(schema.getTypeMap());
|
|
28
25
|
}
|
|
29
26
|
},
|
|
30
27
|
queryType: {
|
|
31
28
|
description: 'The type that query operations will be rooted at.',
|
|
32
|
-
type: GraphQLNonNull(__Type),
|
|
29
|
+
type: new GraphQLNonNull(__Type),
|
|
33
30
|
resolve: function resolve(schema) {
|
|
34
31
|
return schema.getQueryType();
|
|
35
32
|
}
|
|
@@ -50,7 +47,7 @@ export var __Schema = new GraphQLObjectType({
|
|
|
50
47
|
},
|
|
51
48
|
directives: {
|
|
52
49
|
description: 'A list of all directives supported by this server.',
|
|
53
|
-
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive))),
|
|
50
|
+
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),
|
|
54
51
|
resolve: function resolve(schema) {
|
|
55
52
|
return schema.getDirectives();
|
|
56
53
|
}
|
|
@@ -64,7 +61,7 @@ export var __Directive = new GraphQLObjectType({
|
|
|
64
61
|
fields: function fields() {
|
|
65
62
|
return {
|
|
66
63
|
name: {
|
|
67
|
-
type: GraphQLNonNull(GraphQLString),
|
|
64
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
68
65
|
resolve: function resolve(directive) {
|
|
69
66
|
return directive.name;
|
|
70
67
|
}
|
|
@@ -76,19 +73,19 @@ export var __Directive = new GraphQLObjectType({
|
|
|
76
73
|
}
|
|
77
74
|
},
|
|
78
75
|
isRepeatable: {
|
|
79
|
-
type: GraphQLNonNull(GraphQLBoolean),
|
|
76
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
80
77
|
resolve: function resolve(directive) {
|
|
81
78
|
return directive.isRepeatable;
|
|
82
79
|
}
|
|
83
80
|
},
|
|
84
81
|
locations: {
|
|
85
|
-
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__DirectiveLocation))),
|
|
82
|
+
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),
|
|
86
83
|
resolve: function resolve(directive) {
|
|
87
84
|
return directive.locations;
|
|
88
85
|
}
|
|
89
86
|
},
|
|
90
87
|
args: {
|
|
91
|
-
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))),
|
|
88
|
+
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),
|
|
92
89
|
resolve: function resolve(directive) {
|
|
93
90
|
return directive.args;
|
|
94
91
|
}
|
|
@@ -184,7 +181,7 @@ export var __Type = new GraphQLObjectType({
|
|
|
184
181
|
fields: function fields() {
|
|
185
182
|
return {
|
|
186
183
|
kind: {
|
|
187
|
-
type: GraphQLNonNull(__TypeKind),
|
|
184
|
+
type: new GraphQLNonNull(__TypeKind),
|
|
188
185
|
resolve: function resolve(type) {
|
|
189
186
|
if (isScalarType(type)) {
|
|
190
187
|
return TypeKind.SCALAR;
|
|
@@ -242,7 +239,7 @@ export var __Type = new GraphQLObjectType({
|
|
|
242
239
|
}
|
|
243
240
|
},
|
|
244
241
|
fields: {
|
|
245
|
-
type: GraphQLList(GraphQLNonNull(__Field)),
|
|
242
|
+
type: new GraphQLList(new GraphQLNonNull(__Field)),
|
|
246
243
|
args: {
|
|
247
244
|
includeDeprecated: {
|
|
248
245
|
type: GraphQLBoolean,
|
|
@@ -254,21 +251,14 @@ export var __Type = new GraphQLObjectType({
|
|
|
254
251
|
|
|
255
252
|
if (isObjectType(type) || isInterfaceType(type)) {
|
|
256
253
|
var fields = objectValues(type.getFields());
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return !field.isDeprecated;
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return fields;
|
|
254
|
+
return includeDeprecated ? fields : fields.filter(function (field) {
|
|
255
|
+
return field.deprecationReason == null;
|
|
256
|
+
});
|
|
265
257
|
}
|
|
266
|
-
|
|
267
|
-
return null;
|
|
268
258
|
}
|
|
269
259
|
},
|
|
270
260
|
interfaces: {
|
|
271
|
-
type: GraphQLList(GraphQLNonNull(__Type)),
|
|
261
|
+
type: new GraphQLList(new GraphQLNonNull(__Type)),
|
|
272
262
|
resolve: function resolve(type) {
|
|
273
263
|
if (isObjectType(type) || isInterfaceType(type)) {
|
|
274
264
|
return type.getInterfaces();
|
|
@@ -276,7 +266,7 @@ export var __Type = new GraphQLObjectType({
|
|
|
276
266
|
}
|
|
277
267
|
},
|
|
278
268
|
possibleTypes: {
|
|
279
|
-
type: GraphQLList(GraphQLNonNull(__Type)),
|
|
269
|
+
type: new GraphQLList(new GraphQLNonNull(__Type)),
|
|
280
270
|
resolve: function resolve(type, _args, _context, _ref2) {
|
|
281
271
|
var schema = _ref2.schema;
|
|
282
272
|
|
|
@@ -286,7 +276,7 @@ export var __Type = new GraphQLObjectType({
|
|
|
286
276
|
}
|
|
287
277
|
},
|
|
288
278
|
enumValues: {
|
|
289
|
-
type: GraphQLList(GraphQLNonNull(__EnumValue)),
|
|
279
|
+
type: new GraphQLList(new GraphQLNonNull(__EnumValue)),
|
|
290
280
|
args: {
|
|
291
281
|
includeDeprecated: {
|
|
292
282
|
type: GraphQLBoolean,
|
|
@@ -298,22 +288,28 @@ export var __Type = new GraphQLObjectType({
|
|
|
298
288
|
|
|
299
289
|
if (isEnumType(type)) {
|
|
300
290
|
var values = type.getValues();
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
return !value.isDeprecated;
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
return values;
|
|
291
|
+
return includeDeprecated ? values : values.filter(function (field) {
|
|
292
|
+
return field.deprecationReason == null;
|
|
293
|
+
});
|
|
309
294
|
}
|
|
310
295
|
}
|
|
311
296
|
},
|
|
312
297
|
inputFields: {
|
|
313
|
-
type: GraphQLList(GraphQLNonNull(__InputValue)),
|
|
314
|
-
|
|
298
|
+
type: new GraphQLList(new GraphQLNonNull(__InputValue)),
|
|
299
|
+
args: {
|
|
300
|
+
includeDeprecated: {
|
|
301
|
+
type: GraphQLBoolean,
|
|
302
|
+
defaultValue: false
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
resolve: function resolve(type, _ref4) {
|
|
306
|
+
var includeDeprecated = _ref4.includeDeprecated;
|
|
307
|
+
|
|
315
308
|
if (isInputObjectType(type)) {
|
|
316
|
-
|
|
309
|
+
var values = objectValues(type.getFields());
|
|
310
|
+
return includeDeprecated ? values : values.filter(function (field) {
|
|
311
|
+
return field.deprecationReason == null;
|
|
312
|
+
});
|
|
317
313
|
}
|
|
318
314
|
}
|
|
319
315
|
},
|
|
@@ -332,7 +328,7 @@ export var __Field = new GraphQLObjectType({
|
|
|
332
328
|
fields: function fields() {
|
|
333
329
|
return {
|
|
334
330
|
name: {
|
|
335
|
-
type: GraphQLNonNull(GraphQLString),
|
|
331
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
336
332
|
resolve: function resolve(field) {
|
|
337
333
|
return field.name;
|
|
338
334
|
}
|
|
@@ -344,21 +340,30 @@ export var __Field = new GraphQLObjectType({
|
|
|
344
340
|
}
|
|
345
341
|
},
|
|
346
342
|
args: {
|
|
347
|
-
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))),
|
|
348
|
-
|
|
349
|
-
|
|
343
|
+
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),
|
|
344
|
+
args: {
|
|
345
|
+
includeDeprecated: {
|
|
346
|
+
type: GraphQLBoolean,
|
|
347
|
+
defaultValue: false
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
resolve: function resolve(field, _ref5) {
|
|
351
|
+
var includeDeprecated = _ref5.includeDeprecated;
|
|
352
|
+
return includeDeprecated ? field.args : field.args.filter(function (arg) {
|
|
353
|
+
return arg.deprecationReason == null;
|
|
354
|
+
});
|
|
350
355
|
}
|
|
351
356
|
},
|
|
352
357
|
type: {
|
|
353
|
-
type: GraphQLNonNull(__Type),
|
|
358
|
+
type: new GraphQLNonNull(__Type),
|
|
354
359
|
resolve: function resolve(field) {
|
|
355
360
|
return field.type;
|
|
356
361
|
}
|
|
357
362
|
},
|
|
358
363
|
isDeprecated: {
|
|
359
|
-
type: GraphQLNonNull(GraphQLBoolean),
|
|
364
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
360
365
|
resolve: function resolve(field) {
|
|
361
|
-
return field.
|
|
366
|
+
return field.deprecationReason != null;
|
|
362
367
|
}
|
|
363
368
|
},
|
|
364
369
|
deprecationReason: {
|
|
@@ -376,7 +381,7 @@ export var __InputValue = new GraphQLObjectType({
|
|
|
376
381
|
fields: function fields() {
|
|
377
382
|
return {
|
|
378
383
|
name: {
|
|
379
|
-
type: GraphQLNonNull(GraphQLString),
|
|
384
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
380
385
|
resolve: function resolve(inputValue) {
|
|
381
386
|
return inputValue.name;
|
|
382
387
|
}
|
|
@@ -388,7 +393,7 @@ export var __InputValue = new GraphQLObjectType({
|
|
|
388
393
|
}
|
|
389
394
|
},
|
|
390
395
|
type: {
|
|
391
|
-
type: GraphQLNonNull(__Type),
|
|
396
|
+
type: new GraphQLNonNull(__Type),
|
|
392
397
|
resolve: function resolve(inputValue) {
|
|
393
398
|
return inputValue.type;
|
|
394
399
|
}
|
|
@@ -402,6 +407,18 @@ export var __InputValue = new GraphQLObjectType({
|
|
|
402
407
|
var valueAST = astFromValue(defaultValue, type);
|
|
403
408
|
return valueAST ? print(valueAST) : null;
|
|
404
409
|
}
|
|
410
|
+
},
|
|
411
|
+
isDeprecated: {
|
|
412
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
413
|
+
resolve: function resolve(field) {
|
|
414
|
+
return field.deprecationReason != null;
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
deprecationReason: {
|
|
418
|
+
type: GraphQLString,
|
|
419
|
+
resolve: function resolve(obj) {
|
|
420
|
+
return obj.deprecationReason;
|
|
421
|
+
}
|
|
405
422
|
}
|
|
406
423
|
};
|
|
407
424
|
}
|
|
@@ -412,7 +429,7 @@ export var __EnumValue = new GraphQLObjectType({
|
|
|
412
429
|
fields: function fields() {
|
|
413
430
|
return {
|
|
414
431
|
name: {
|
|
415
|
-
type: GraphQLNonNull(GraphQLString),
|
|
432
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
416
433
|
resolve: function resolve(enumValue) {
|
|
417
434
|
return enumValue.name;
|
|
418
435
|
}
|
|
@@ -424,9 +441,9 @@ export var __EnumValue = new GraphQLObjectType({
|
|
|
424
441
|
}
|
|
425
442
|
},
|
|
426
443
|
isDeprecated: {
|
|
427
|
-
type: GraphQLNonNull(GraphQLBoolean),
|
|
444
|
+
type: new GraphQLNonNull(GraphQLBoolean),
|
|
428
445
|
resolve: function resolve(enumValue) {
|
|
429
|
-
return enumValue.
|
|
446
|
+
return enumValue.deprecationReason != null;
|
|
430
447
|
}
|
|
431
448
|
},
|
|
432
449
|
deprecationReason: {
|
|
@@ -493,11 +510,11 @@ export var __TypeKind = new GraphQLEnumType({
|
|
|
493
510
|
|
|
494
511
|
export var SchemaMetaFieldDef = {
|
|
495
512
|
name: '__schema',
|
|
496
|
-
type: GraphQLNonNull(__Schema),
|
|
513
|
+
type: new GraphQLNonNull(__Schema),
|
|
497
514
|
description: 'Access the current type schema of this server.',
|
|
498
515
|
args: [],
|
|
499
|
-
resolve: function resolve(_source, _args, _context,
|
|
500
|
-
var schema =
|
|
516
|
+
resolve: function resolve(_source, _args, _context, _ref6) {
|
|
517
|
+
var schema = _ref6.schema;
|
|
501
518
|
return schema;
|
|
502
519
|
},
|
|
503
520
|
isDeprecated: false,
|
|
@@ -512,14 +529,15 @@ export var TypeMetaFieldDef = {
|
|
|
512
529
|
args: [{
|
|
513
530
|
name: 'name',
|
|
514
531
|
description: undefined,
|
|
515
|
-
type: GraphQLNonNull(GraphQLString),
|
|
532
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
516
533
|
defaultValue: undefined,
|
|
534
|
+
deprecationReason: undefined,
|
|
517
535
|
extensions: undefined,
|
|
518
536
|
astNode: undefined
|
|
519
537
|
}],
|
|
520
|
-
resolve: function resolve(_source,
|
|
521
|
-
var name =
|
|
522
|
-
var schema =
|
|
538
|
+
resolve: function resolve(_source, _ref7, _context, _ref8) {
|
|
539
|
+
var name = _ref7.name;
|
|
540
|
+
var schema = _ref8.schema;
|
|
523
541
|
return schema.getType(name);
|
|
524
542
|
},
|
|
525
543
|
isDeprecated: false,
|
|
@@ -529,11 +547,11 @@ export var TypeMetaFieldDef = {
|
|
|
529
547
|
};
|
|
530
548
|
export var TypeNameMetaFieldDef = {
|
|
531
549
|
name: '__typename',
|
|
532
|
-
type: GraphQLNonNull(GraphQLString),
|
|
550
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
533
551
|
description: 'The name of the current Object type at runtime.',
|
|
534
552
|
args: [],
|
|
535
|
-
resolve: function resolve(_source, _args, _context,
|
|
536
|
-
var parentType =
|
|
553
|
+
resolve: function resolve(_source, _args, _context, _ref9) {
|
|
554
|
+
var parentType = _ref9.parentType;
|
|
537
555
|
return parentType.name;
|
|
538
556
|
},
|
|
539
557
|
isDeprecated: false,
|
|
@@ -543,8 +561,8 @@ export var TypeNameMetaFieldDef = {
|
|
|
543
561
|
};
|
|
544
562
|
export var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]);
|
|
545
563
|
export function isIntrospectionType(type) {
|
|
546
|
-
return introspectionTypes.some(function (
|
|
547
|
-
var name =
|
|
564
|
+
return introspectionTypes.some(function (_ref10) {
|
|
565
|
+
var name = _ref10.name;
|
|
548
566
|
return type.name === name;
|
|
549
567
|
});
|
|
550
568
|
}
|
package/type/scalars.js
CHANGED
|
@@ -6,21 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.isSpecifiedScalarType = isSpecifiedScalarType;
|
|
7
7
|
exports.specifiedScalarTypes = exports.GraphQLID = exports.GraphQLBoolean = exports.GraphQLString = exports.GraphQLFloat = exports.GraphQLInt = void 0;
|
|
8
8
|
|
|
9
|
-
var _isFinite = _interopRequireDefault(require("../polyfills/isFinite"));
|
|
9
|
+
var _isFinite = _interopRequireDefault(require("../polyfills/isFinite.js"));
|
|
10
10
|
|
|
11
|
-
var _isInteger = _interopRequireDefault(require("../polyfills/isInteger"));
|
|
11
|
+
var _isInteger = _interopRequireDefault(require("../polyfills/isInteger.js"));
|
|
12
12
|
|
|
13
|
-
var _inspect = _interopRequireDefault(require("../jsutils/inspect"));
|
|
13
|
+
var _inspect = _interopRequireDefault(require("../jsutils/inspect.js"));
|
|
14
14
|
|
|
15
|
-
var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike"));
|
|
15
|
+
var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js"));
|
|
16
16
|
|
|
17
|
-
var _kinds = require("../language/kinds");
|
|
17
|
+
var _kinds = require("../language/kinds.js");
|
|
18
18
|
|
|
19
|
-
var _printer = require("../language/printer");
|
|
19
|
+
var _printer = require("../language/printer.js");
|
|
20
20
|
|
|
21
|
-
var _GraphQLError = require("../error/GraphQLError");
|
|
21
|
+
var _GraphQLError = require("../error/GraphQLError.js");
|
|
22
22
|
|
|
23
|
-
var _definition = require("./definition");
|
|
23
|
+
var _definition = require("./definition.js");
|
|
24
24
|
|
|
25
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
26
|
|
|
@@ -146,7 +146,7 @@ function serializeObject(outputValue) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
if (typeof outputValue.toJSON === 'function') {
|
|
149
|
-
// $FlowFixMe
|
|
149
|
+
// $FlowFixMe[incompatible-use]
|
|
150
150
|
return outputValue.toJSON();
|
|
151
151
|
}
|
|
152
152
|
}
|