graphql 16.14.2 → 16.15.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/error/GraphQLError.d.ts +5 -1
- package/error/GraphQLError.js +12 -7
- package/error/GraphQLError.mjs +13 -6
- package/error/locatedError.d.ts +6 -4
- package/error/locatedError.js +6 -4
- package/error/locatedError.mjs +6 -4
- package/execution/collectFields.d.ts +1 -0
- package/execution/collectFields.js +9 -0
- package/execution/collectFields.mjs +9 -0
- package/execution/execute.d.ts +9 -10
- package/execution/execute.js +44 -29
- package/execution/execute.mjs +44 -29
- package/execution/mapAsyncIterator.js +12 -11
- package/execution/mapAsyncIterator.mjs +12 -11
- package/execution/subscribe.d.ts +5 -2
- package/execution/subscribe.js +5 -2
- package/execution/subscribe.mjs +5 -2
- package/execution/values.d.ts +43 -21
- package/execution/values.js +52 -24
- package/execution/values.mjs +51 -23
- package/graphql.d.ts +8 -14
- package/graphql.js +16 -15
- package/graphql.mjs +11 -15
- package/jsutils/SetMap.d.ts +14 -0
- package/jsutils/SetMap.js +48 -0
- package/jsutils/SetMap.mjs +39 -0
- package/jsutils/isIterableObject.d.ts +2 -0
- package/jsutils/isIterableObject.js +2 -0
- package/jsutils/isIterableObject.mjs +2 -0
- package/jsutils/keyMap.d.ts +2 -0
- package/jsutils/keyMap.js +2 -0
- package/jsutils/keyMap.mjs +2 -0
- package/jsutils/keyValMap.d.ts +3 -3
- package/jsutils/keyValMap.js +3 -3
- package/jsutils/keyValMap.mjs +3 -3
- package/language/ast.d.ts +2 -6
- package/language/ast.js +2 -6
- package/language/ast.mjs +2 -6
- package/language/lexer.d.ts +6 -0
- package/language/lexer.js +22 -0
- package/language/lexer.mjs +22 -0
- package/language/location.d.ts +8 -3
- package/language/location.js +57 -17
- package/language/location.mjs +56 -16
- package/language/parser.d.ts +27 -13
- package/language/parser.js +31 -9
- package/language/parser.mjs +31 -9
- package/language/predicates.d.ts +10 -3
- package/language/predicates.js +10 -3
- package/language/predicates.mjs +10 -3
- package/language/printLocation.d.ts +2 -6
- package/language/printLocation.js +2 -6
- package/language/printLocation.mjs +2 -6
- package/language/printer.d.ts +22 -3
- package/language/printer.js +394 -308
- package/language/printer.mjs +394 -308
- package/language/reducer.d.ts +32 -0
- package/language/reducer.js +95 -0
- package/language/reducer.mjs +86 -0
- package/language/source.d.ts +4 -5
- package/language/source.js +4 -5
- package/language/source.mjs +4 -5
- package/language/visitor.d.ts +16 -10
- package/language/visitor.js +15 -7
- package/language/visitor.mjs +15 -7
- package/package.json +1 -4
- package/type/definition.d.ts +170 -102
- package/type/definition.js +169 -96
- package/type/definition.mjs +168 -95
- package/type/directives.d.ts +12 -6
- package/type/directives.js +12 -6
- package/type/directives.mjs +12 -6
- package/type/scalars.js +8 -11
- package/type/scalars.mjs +1 -1
- package/type/schema.d.ts +36 -11
- package/type/schema.js +35 -10
- package/type/schema.mjs +35 -10
- package/type/validate.d.ts +1 -3
- package/type/validate.js +1 -3
- package/type/validate.mjs +1 -3
- package/utilities/TypeInfo.d.ts +15 -11
- package/utilities/TypeInfo.js +15 -11
- package/utilities/TypeInfo.mjs +15 -11
- package/utilities/assertValidName.d.ts +1 -1
- package/utilities/assertValidName.js +1 -1
- package/utilities/assertValidName.mjs +1 -1
- package/utilities/astFromValue.d.ts +3 -1
- package/utilities/astFromValue.js +3 -1
- package/utilities/astFromValue.mjs +3 -1
- package/utilities/buildASTSchema.d.ts +8 -8
- package/utilities/buildASTSchema.js +9 -20
- package/utilities/buildASTSchema.mjs +9 -20
- package/utilities/buildClientSchema.d.ts +6 -2
- package/utilities/buildClientSchema.js +6 -2
- package/utilities/buildClientSchema.mjs +6 -2
- package/utilities/coerceInputValue.d.ts +9 -3
- package/utilities/coerceInputValue.js +60 -13
- package/utilities/coerceInputValue.mjs +58 -13
- package/utilities/concatAST.d.ts +4 -1
- package/utilities/concatAST.js +4 -1
- package/utilities/concatAST.mjs +4 -1
- package/utilities/extendSchema.d.ts +7 -4
- package/utilities/extendSchema.js +7 -4
- package/utilities/extendSchema.mjs +7 -4
- package/utilities/findBreakingChanges.d.ts +2 -2
- package/utilities/findBreakingChanges.js +2 -2
- package/utilities/findBreakingChanges.mjs +2 -2
- package/utilities/getIntrospectionQuery.d.ts +9 -9
- package/utilities/getIntrospectionQuery.js +8 -8
- package/utilities/getIntrospectionQuery.mjs +8 -8
- package/utilities/getOperationAST.d.ts +2 -2
- package/utilities/getOperationAST.js +2 -2
- package/utilities/getOperationAST.mjs +2 -2
- package/utilities/getOperationRootType.d.ts +3 -1
- package/utilities/getOperationRootType.js +3 -1
- package/utilities/getOperationRootType.mjs +3 -1
- package/utilities/introspectionFromSchema.d.ts +12 -4
- package/utilities/introspectionFromSchema.js +12 -4
- package/utilities/introspectionFromSchema.mjs +12 -4
- package/utilities/lexicographicSortSchema.d.ts +17 -13
- package/utilities/lexicographicSortSchema.js +17 -13
- package/utilities/lexicographicSortSchema.mjs +17 -13
- package/utilities/printSchema.d.ts +7 -4
- package/utilities/printSchema.js +7 -4
- package/utilities/printSchema.mjs +7 -4
- package/utilities/resolveSchemaCoordinate.d.ts +9 -8
- package/utilities/resolveSchemaCoordinate.js +9 -8
- package/utilities/resolveSchemaCoordinate.mjs +9 -8
- package/utilities/separateOperations.d.ts +2 -2
- package/utilities/separateOperations.js +2 -2
- package/utilities/separateOperations.mjs +2 -2
- package/utilities/stripIgnoredCharacters.d.ts +19 -5
- package/utilities/stripIgnoredCharacters.js +19 -5
- package/utilities/stripIgnoredCharacters.mjs +19 -5
- package/utilities/typeComparators.d.ts +1 -5
- package/utilities/typeComparators.js +1 -5
- package/utilities/typeComparators.mjs +1 -5
- package/utilities/valueFromAST.js +4 -4
- package/utilities/valueFromAST.mjs +4 -4
- package/utilities/valueFromASTUntyped.d.ts +1 -3
- package/utilities/valueFromASTUntyped.js +1 -3
- package/utilities/valueFromASTUntyped.mjs +1 -3
- package/validation/ValidationContext.d.ts +22 -3
- package/validation/ValidationContext.js +84 -27
- package/validation/ValidationContext.mjs +82 -27
- package/validation/rules/ExecutableDefinitionsRule.d.ts +6 -4
- package/validation/rules/ExecutableDefinitionsRule.js +6 -4
- package/validation/rules/ExecutableDefinitionsRule.mjs +6 -4
- package/validation/rules/FieldsOnCorrectTypeRule.d.ts +4 -4
- package/validation/rules/FieldsOnCorrectTypeRule.js +10 -6
- package/validation/rules/FieldsOnCorrectTypeRule.mjs +12 -6
- package/validation/rules/FragmentsOnCompositeTypesRule.d.ts +6 -4
- package/validation/rules/FragmentsOnCompositeTypesRule.js +6 -4
- package/validation/rules/FragmentsOnCompositeTypesRule.mjs +6 -4
- package/validation/rules/KnownArgumentNamesRule.d.ts +4 -4
- package/validation/rules/KnownArgumentNamesRule.js +26 -17
- package/validation/rules/KnownArgumentNamesRule.mjs +21 -11
- package/validation/rules/KnownDirectivesRule.d.ts +1 -3
- package/validation/rules/KnownDirectivesRule.js +1 -3
- package/validation/rules/KnownDirectivesRule.mjs +1 -3
- package/validation/rules/KnownFragmentNamesRule.d.ts +4 -4
- package/validation/rules/KnownFragmentNamesRule.js +4 -4
- package/validation/rules/KnownFragmentNamesRule.mjs +4 -4
- package/validation/rules/KnownTypeNamesRule.d.ts +1 -3
- package/validation/rules/KnownTypeNamesRule.js +7 -7
- package/validation/rules/KnownTypeNamesRule.mjs +7 -7
- package/validation/rules/LoneAnonymousOperationRule.d.ts +6 -4
- package/validation/rules/LoneAnonymousOperationRule.js +6 -4
- package/validation/rules/LoneAnonymousOperationRule.mjs +6 -4
- package/validation/rules/MaxIntrospectionDepthRule.d.ts +6 -4
- package/validation/rules/MaxIntrospectionDepthRule.js +44 -19
- package/validation/rules/MaxIntrospectionDepthRule.mjs +44 -19
- package/validation/rules/NoFragmentCyclesRule.d.ts +1 -3
- package/validation/rules/NoFragmentCyclesRule.js +1 -3
- package/validation/rules/NoFragmentCyclesRule.mjs +1 -3
- package/validation/rules/NoUndefinedVariablesRule.d.ts +4 -4
- package/validation/rules/NoUndefinedVariablesRule.js +4 -4
- package/validation/rules/NoUndefinedVariablesRule.mjs +4 -4
- package/validation/rules/NoUnusedFragmentsRule.d.ts +4 -4
- package/validation/rules/NoUnusedFragmentsRule.js +10 -14
- package/validation/rules/NoUnusedFragmentsRule.mjs +10 -14
- package/validation/rules/NoUnusedVariablesRule.d.ts +4 -4
- package/validation/rules/NoUnusedVariablesRule.js +4 -4
- package/validation/rules/NoUnusedVariablesRule.mjs +4 -4
- package/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +8 -6
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js +552 -354
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +545 -352
- package/validation/rules/PossibleFragmentSpreadsRule.d.ts +6 -4
- package/validation/rules/PossibleFragmentSpreadsRule.js +6 -4
- package/validation/rules/PossibleFragmentSpreadsRule.mjs +6 -4
- package/validation/rules/ProvidedRequiredArgumentsRule.d.ts +6 -4
- package/validation/rules/ProvidedRequiredArgumentsRule.js +6 -4
- package/validation/rules/ProvidedRequiredArgumentsRule.mjs +6 -4
- package/validation/rules/ScalarLeafsRule.d.ts +1 -3
- package/validation/rules/ScalarLeafsRule.js +1 -3
- package/validation/rules/ScalarLeafsRule.mjs +1 -3
- package/validation/rules/SingleFieldSubscriptionsRule.d.ts +6 -4
- package/validation/rules/SingleFieldSubscriptionsRule.js +50 -9
- package/validation/rules/SingleFieldSubscriptionsRule.mjs +50 -9
- package/validation/rules/UniqueArgumentNamesRule.d.ts +4 -4
- package/validation/rules/UniqueArgumentNamesRule.js +4 -4
- package/validation/rules/UniqueArgumentNamesRule.mjs +4 -4
- package/validation/rules/UniqueDirectivesPerLocationRule.d.ts +6 -4
- package/validation/rules/UniqueDirectivesPerLocationRule.js +6 -4
- package/validation/rules/UniqueDirectivesPerLocationRule.mjs +6 -4
- package/validation/rules/UniqueFragmentNamesRule.d.ts +4 -4
- package/validation/rules/UniqueFragmentNamesRule.js +4 -4
- package/validation/rules/UniqueFragmentNamesRule.mjs +4 -4
- package/validation/rules/UniqueInputFieldNamesRule.d.ts +6 -4
- package/validation/rules/UniqueInputFieldNamesRule.js +6 -4
- package/validation/rules/UniqueInputFieldNamesRule.mjs +6 -4
- package/validation/rules/UniqueOperationNamesRule.d.ts +4 -4
- package/validation/rules/UniqueOperationNamesRule.js +4 -4
- package/validation/rules/UniqueOperationNamesRule.mjs +4 -4
- package/validation/rules/UniqueVariableNamesRule.d.ts +4 -4
- package/validation/rules/UniqueVariableNamesRule.js +4 -4
- package/validation/rules/UniqueVariableNamesRule.mjs +4 -4
- package/validation/rules/ValuesOfCorrectTypeRule.d.ts +4 -4
- package/validation/rules/ValuesOfCorrectTypeRule.js +29 -23
- package/validation/rules/ValuesOfCorrectTypeRule.mjs +24 -14
- package/validation/rules/VariablesAreInputTypesRule.d.ts +6 -4
- package/validation/rules/VariablesAreInputTypesRule.js +6 -4
- package/validation/rules/VariablesAreInputTypesRule.mjs +6 -4
- package/validation/rules/VariablesInAllowedPositionRule.d.ts +6 -4
- package/validation/rules/VariablesInAllowedPositionRule.js +6 -4
- package/validation/rules/VariablesInAllowedPositionRule.mjs +6 -4
- package/validation/rules/custom/NoDeprecatedCustomRule.d.ts +4 -4
- package/validation/rules/custom/NoDeprecatedCustomRule.js +4 -4
- package/validation/rules/custom/NoDeprecatedCustomRule.mjs +4 -4
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +7 -5
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +7 -5
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +7 -5
- package/validation/validate.d.ts +2 -0
- package/validation/validate.js +14 -2
- package/validation/validate.mjs +13 -2
- package/validation/validationAbortedError.d.ts +3 -0
- package/validation/validationAbortedError.js +14 -0
- package/validation/validationAbortedError.mjs +4 -0
- package/version.js +3 -3
- package/version.mjs +3 -3
package/validation/validate.js
CHANGED
|
@@ -24,6 +24,8 @@ var _TypeInfo = require('../utilities/TypeInfo.js');
|
|
|
24
24
|
|
|
25
25
|
var _specifiedRules = require('./specifiedRules.js');
|
|
26
26
|
|
|
27
|
+
var _validationAbortedError = require('./validationAbortedError.js');
|
|
28
|
+
|
|
27
29
|
var _ValidationContext = require('./ValidationContext.js');
|
|
28
30
|
|
|
29
31
|
/** @category Validation */
|
|
@@ -119,7 +121,7 @@ function validate(
|
|
|
119
121
|
*/
|
|
120
122
|
typeInfo = new _TypeInfo.TypeInfo(schema),
|
|
121
123
|
) {
|
|
122
|
-
var _options$maxErrors;
|
|
124
|
+
var _options$maxErrors, _options$hideSuggesti;
|
|
123
125
|
|
|
124
126
|
const maxErrors =
|
|
125
127
|
(_options$maxErrors =
|
|
@@ -127,6 +129,13 @@ function validate(
|
|
|
127
129
|
null && _options$maxErrors !== void 0
|
|
128
130
|
? _options$maxErrors
|
|
129
131
|
: 100;
|
|
132
|
+
const hideSuggestions =
|
|
133
|
+
(_options$hideSuggesti =
|
|
134
|
+
options === null || options === void 0
|
|
135
|
+
? void 0
|
|
136
|
+
: options.hideSuggestions) !== null && _options$hideSuggesti !== void 0
|
|
137
|
+
? _options$hideSuggesti
|
|
138
|
+
: false;
|
|
130
139
|
documentAST || (0, _devAssert.devAssert)(false, 'Must provide document.'); // If the schema used for validation is invalid, throw an error.
|
|
131
140
|
|
|
132
141
|
(0, _validate.assertValidSchema)(schema);
|
|
@@ -149,6 +158,7 @@ function validate(
|
|
|
149
158
|
|
|
150
159
|
errors.push(error);
|
|
151
160
|
},
|
|
161
|
+
hideSuggestions,
|
|
152
162
|
); // This uses a specialized visitor which runs multiple visitors in parallel,
|
|
153
163
|
// while maintaining the visitor skip and break API.
|
|
154
164
|
|
|
@@ -163,7 +173,9 @@ function validate(
|
|
|
163
173
|
QueryDocumentKeysToValidate,
|
|
164
174
|
);
|
|
165
175
|
} catch (e) {
|
|
166
|
-
if (e
|
|
176
|
+
if (e === _validationAbortedError.validationAbortedError) {
|
|
177
|
+
errors.push(_validationAbortedError.validationAbortedError);
|
|
178
|
+
} else if (e !== abortObj) {
|
|
167
179
|
throw e;
|
|
168
180
|
}
|
|
169
181
|
}
|
package/validation/validate.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import { visit, visitInParallel } from '../language/visitor.mjs';
|
|
|
7
7
|
import { assertValidSchema } from '../type/validate.mjs';
|
|
8
8
|
import { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.mjs';
|
|
9
9
|
import { specifiedRules, specifiedSDLRules } from './specifiedRules.mjs';
|
|
10
|
+
import { validationAbortedError } from './validationAbortedError.mjs';
|
|
10
11
|
import {
|
|
11
12
|
SDLValidationContext,
|
|
12
13
|
ValidationContext,
|
|
@@ -102,7 +103,7 @@ export function validate(
|
|
|
102
103
|
*/
|
|
103
104
|
typeInfo = new TypeInfo(schema),
|
|
104
105
|
) {
|
|
105
|
-
var _options$maxErrors;
|
|
106
|
+
var _options$maxErrors, _options$hideSuggesti;
|
|
106
107
|
|
|
107
108
|
const maxErrors =
|
|
108
109
|
(_options$maxErrors =
|
|
@@ -110,6 +111,13 @@ export function validate(
|
|
|
110
111
|
null && _options$maxErrors !== void 0
|
|
111
112
|
? _options$maxErrors
|
|
112
113
|
: 100;
|
|
114
|
+
const hideSuggestions =
|
|
115
|
+
(_options$hideSuggesti =
|
|
116
|
+
options === null || options === void 0
|
|
117
|
+
? void 0
|
|
118
|
+
: options.hideSuggestions) !== null && _options$hideSuggesti !== void 0
|
|
119
|
+
? _options$hideSuggesti
|
|
120
|
+
: false;
|
|
113
121
|
documentAST || devAssert(false, 'Must provide document.'); // If the schema used for validation is invalid, throw an error.
|
|
114
122
|
|
|
115
123
|
assertValidSchema(schema);
|
|
@@ -132,6 +140,7 @@ export function validate(
|
|
|
132
140
|
|
|
133
141
|
errors.push(error);
|
|
134
142
|
},
|
|
143
|
+
hideSuggestions,
|
|
135
144
|
); // This uses a specialized visitor which runs multiple visitors in parallel,
|
|
136
145
|
// while maintaining the visitor skip and break API.
|
|
137
146
|
|
|
@@ -144,7 +153,9 @@ export function validate(
|
|
|
144
153
|
QueryDocumentKeysToValidate,
|
|
145
154
|
);
|
|
146
155
|
} catch (e) {
|
|
147
|
-
if (e
|
|
156
|
+
if (e === validationAbortedError) {
|
|
157
|
+
errors.push(validationAbortedError);
|
|
158
|
+
} else if (e !== abortObj) {
|
|
148
159
|
throw e;
|
|
149
160
|
}
|
|
150
161
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
exports.validationAbortedError = void 0;
|
|
7
|
+
|
|
8
|
+
var _GraphQLError = require('../error/GraphQLError.js');
|
|
9
|
+
|
|
10
|
+
/** @internal */
|
|
11
|
+
const validationAbortedError = new _GraphQLError.GraphQLError(
|
|
12
|
+
'Validation aborted.',
|
|
13
|
+
);
|
|
14
|
+
exports.validationAbortedError = validationAbortedError;
|
package/version.js
CHANGED
|
@@ -10,14 +10,14 @@ exports.versionInfo = exports.version = void 0;
|
|
|
10
10
|
// automatically updated by "npm version" command.
|
|
11
11
|
|
|
12
12
|
/** A string containing the version of the GraphQL.js library */
|
|
13
|
-
const version = '16.
|
|
13
|
+
const version = '16.15.0';
|
|
14
14
|
/** An object containing the components of the GraphQL.js version string */
|
|
15
15
|
|
|
16
16
|
exports.version = version;
|
|
17
17
|
const versionInfo = Object.freeze({
|
|
18
18
|
major: 16,
|
|
19
|
-
minor:
|
|
20
|
-
patch:
|
|
19
|
+
minor: 15,
|
|
20
|
+
patch: 0,
|
|
21
21
|
preReleaseTag: null,
|
|
22
22
|
});
|
|
23
23
|
exports.versionInfo = versionInfo;
|
package/version.mjs
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// automatically updated by "npm version" command.
|
|
4
4
|
|
|
5
5
|
/** A string containing the version of the GraphQL.js library */
|
|
6
|
-
export const version = '16.
|
|
6
|
+
export const version = '16.15.0';
|
|
7
7
|
/** An object containing the components of the GraphQL.js version string */
|
|
8
8
|
|
|
9
9
|
export const versionInfo = Object.freeze({
|
|
10
10
|
major: 16,
|
|
11
|
-
minor:
|
|
12
|
-
patch:
|
|
11
|
+
minor: 15,
|
|
12
|
+
patch: 0,
|
|
13
13
|
preReleaseTag: null,
|
|
14
14
|
});
|