@graphql-tools/utils 10.6.2 → 10.6.3
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/cjs/Path.js +3 -4
- package/cjs/addTypes.js +1 -2
- package/cjs/astFromType.js +1 -2
- package/cjs/astFromValue.js +1 -2
- package/cjs/astFromValueUntyped.js +1 -2
- package/cjs/build-operation-for-field.js +1 -2
- package/cjs/collectFields.js +6 -6
- package/cjs/comments.js +10 -11
- package/cjs/createDeferred.js +1 -2
- package/cjs/debugTimer.js +2 -3
- package/cjs/descriptionFromObject.js +1 -2
- package/cjs/errors.js +2 -3
- package/cjs/extractExtensionsFromSchema.js +1 -2
- package/cjs/fakePromise.js +2 -3
- package/cjs/fields.js +4 -5
- package/cjs/filterSchema.js +1 -2
- package/cjs/fixSchemaAst.js +1 -2
- package/cjs/forEachDefaultValue.js +1 -2
- package/cjs/forEachField.js +1 -2
- package/cjs/get-arguments-with-directives.js +1 -2
- package/cjs/get-directives.js +4 -5
- package/cjs/get-fields-with-directives.js +1 -2
- package/cjs/get-implementing-types.js +1 -2
- package/cjs/getArgumentValues.js +1 -2
- package/cjs/getDirectiveExtensions.js +1 -2
- package/cjs/getObjectTypeFromTypeMap.js +1 -2
- package/cjs/getOperationASTFromRequest.js +2 -2
- package/cjs/getResolversFromSchema.js +1 -2
- package/cjs/getResponseKeyFromInfo.js +1 -2
- package/cjs/heal.js +2 -3
- package/cjs/helpers.js +8 -8
- package/cjs/implementsAbstractType.js +1 -2
- package/cjs/isAsyncIterable.js +1 -2
- package/cjs/isDocumentNode.js +1 -2
- package/cjs/jsutils.js +5 -6
- package/cjs/map-maybe-promise.js +1 -2
- package/cjs/mapAsyncIterator.js +1 -2
- package/cjs/mapSchema.js +2 -3
- package/cjs/memoize.js +7 -8
- package/cjs/mergeDeep.js +1 -2
- package/cjs/mergeIncrementalResult.js +1 -2
- package/cjs/observableToAsyncIterable.js +1 -2
- package/cjs/parse-graphql-json.js +1 -2
- package/cjs/parse-graphql-sdl.js +3 -4
- package/cjs/print-schema-with-directives.js +18 -19
- package/cjs/prune.js +1 -2
- package/cjs/renameType.js +1 -2
- package/cjs/rewire.js +1 -2
- package/cjs/rootTypes.js +2 -2
- package/cjs/selectionSets.js +1 -2
- package/cjs/stub.js +4 -5
- package/cjs/transformInputValue.js +4 -5
- package/cjs/updateArgument.js +2 -3
- package/cjs/validate-documents.js +2 -3
- package/cjs/valueMatchesCriteria.js +1 -2
- package/cjs/visitResult.js +3 -4
- package/cjs/withCancel.js +3 -4
- package/package.json +1 -1
- package/typings/Interfaces.d.cts +5 -1
- package/typings/Interfaces.d.ts +5 -1
- package/typings/getResponseKeyFromInfo.d.cts +1 -1
- package/typings/getResponseKeyFromInfo.d.ts +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validateGraphQlDocuments = validateGraphQlDocuments;
|
|
4
|
+
exports.createDefaultRules = createDefaultRules;
|
|
4
5
|
const graphql_1 = require("graphql");
|
|
5
6
|
function validateGraphQlDocuments(schema, documents, rules = createDefaultRules()) {
|
|
6
7
|
const definitions = new Set();
|
|
@@ -30,7 +31,6 @@ function validateGraphQlDocuments(schema, documents, rules = createDefaultRules(
|
|
|
30
31
|
}
|
|
31
32
|
return errors;
|
|
32
33
|
}
|
|
33
|
-
exports.validateGraphQlDocuments = validateGraphQlDocuments;
|
|
34
34
|
function createDefaultRules() {
|
|
35
35
|
let ignored = ['NoUnusedFragmentsRule', 'NoUnusedVariablesRule', 'KnownDirectivesRule'];
|
|
36
36
|
if (graphql_1.versionInfo.major < 15) {
|
|
@@ -38,4 +38,3 @@ function createDefaultRules() {
|
|
|
38
38
|
}
|
|
39
39
|
return graphql_1.specifiedRules.filter((f) => !ignored.includes(f.name));
|
|
40
40
|
}
|
|
41
|
-
exports.createDefaultRules = createDefaultRules;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.valueMatchesCriteria =
|
|
3
|
+
exports.valueMatchesCriteria = valueMatchesCriteria;
|
|
4
4
|
function valueMatchesCriteria(value, criteria) {
|
|
5
5
|
if (value == null) {
|
|
6
6
|
return value === criteria;
|
|
@@ -19,4 +19,3 @@ function valueMatchesCriteria(value, criteria) {
|
|
|
19
19
|
}
|
|
20
20
|
return value === criteria;
|
|
21
21
|
}
|
|
22
|
-
exports.valueMatchesCriteria = valueMatchesCriteria;
|
package/cjs/visitResult.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.visitData = visitData;
|
|
4
|
+
exports.visitErrors = visitErrors;
|
|
5
|
+
exports.visitResult = visitResult;
|
|
4
6
|
const graphql_1 = require("graphql");
|
|
5
7
|
const collectFields_js_1 = require("./collectFields.js");
|
|
6
8
|
const getOperationASTFromRequest_js_1 = require("./getOperationASTFromRequest.js");
|
|
@@ -22,11 +24,9 @@ function visitData(data, enter, leave) {
|
|
|
22
24
|
}
|
|
23
25
|
return data;
|
|
24
26
|
}
|
|
25
|
-
exports.visitData = visitData;
|
|
26
27
|
function visitErrors(errors, visitor) {
|
|
27
28
|
return errors.map(error => visitor(error));
|
|
28
29
|
}
|
|
29
|
-
exports.visitErrors = visitErrors;
|
|
30
30
|
function visitResult(result, request, schema, resultVisitorMap, errorVisitorMap) {
|
|
31
31
|
const fragments = request.document.definitions.reduce((acc, def) => {
|
|
32
32
|
if (def.kind === graphql_1.Kind.FRAGMENT_DEFINITION) {
|
|
@@ -51,7 +51,6 @@ function visitResult(result, request, schema, resultVisitorMap, errorVisitorMap)
|
|
|
51
51
|
}
|
|
52
52
|
return result;
|
|
53
53
|
}
|
|
54
|
-
exports.visitResult = visitResult;
|
|
55
54
|
function visitErrorsByType(errors, errorVisitorMap, errorInfo) {
|
|
56
55
|
const segmentInfoMap = errorInfo.segmentInfoMap;
|
|
57
56
|
const unpathedErrors = errorInfo.unpathedErrors;
|
package/cjs/withCancel.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAsyncIteratorWithCancel = getAsyncIteratorWithCancel;
|
|
4
|
+
exports.getAsyncIterableWithCancel = getAsyncIterableWithCancel;
|
|
5
|
+
exports.withCancel = getAsyncIterableWithCancel;
|
|
4
6
|
const memoize_js_1 = require("./memoize.js");
|
|
5
7
|
async function defaultAsyncIteratorReturn(value) {
|
|
6
8
|
return { value, done: true };
|
|
@@ -34,7 +36,6 @@ function getAsyncIteratorWithCancel(asyncIterator, onCancel) {
|
|
|
34
36
|
},
|
|
35
37
|
});
|
|
36
38
|
}
|
|
37
|
-
exports.getAsyncIteratorWithCancel = getAsyncIteratorWithCancel;
|
|
38
39
|
function getAsyncIterableWithCancel(asyncIterable, onCancel) {
|
|
39
40
|
return new Proxy(asyncIterable, {
|
|
40
41
|
get(asyncIterable, prop, receiver) {
|
|
@@ -52,5 +53,3 @@ function getAsyncIterableWithCancel(asyncIterable, onCancel) {
|
|
|
52
53
|
},
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
exports.getAsyncIterableWithCancel = getAsyncIterableWithCancel;
|
|
56
|
-
exports.withCancel = getAsyncIterableWithCancel;
|
package/package.json
CHANGED
package/typings/Interfaces.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, GraphQLArgument, GraphQLArgumentConfig, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLEnumValueConfig, GraphQLError, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLIsTypeOfFn, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType,
|
|
1
|
+
import { DefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, GraphQLArgument, GraphQLArgumentConfig, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLEnumValueConfig, GraphQLError, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLIsTypeOfFn, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLScalarLiteralParser, GraphQLScalarSerializer, GraphQLScalarType, GraphQLScalarValueParser, GraphQLSchema, GraphQLType, GraphQLTypeResolver, GraphQLUnionType, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, GraphQLResolveInfo as OrigGraphQLResolveInfo, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SelectionNode, Source, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql';
|
|
2
2
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
3
3
|
/**
|
|
4
4
|
* The result of GraphQL execution.
|
|
@@ -18,6 +18,9 @@ export interface ExecutionResult<TData = any, TExtensions = any> {
|
|
|
18
18
|
path?: ReadonlyArray<string | number>;
|
|
19
19
|
items?: TData | null;
|
|
20
20
|
}
|
|
21
|
+
export interface GraphQLResolveInfo extends OrigGraphQLResolveInfo {
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
}
|
|
21
24
|
export interface ExecutionRequest<TVariables extends Record<string, any> = any, TContext = any, TRootValue = any, TExtensions = Record<string, any>, TReturn = any> {
|
|
22
25
|
document: TypedDocumentNode<TReturn, TVariables>;
|
|
23
26
|
variables?: TVariables;
|
|
@@ -27,6 +30,7 @@ export interface ExecutionRequest<TVariables extends Record<string, any> = any,
|
|
|
27
30
|
rootValue?: TRootValue;
|
|
28
31
|
context?: TContext;
|
|
29
32
|
info?: GraphQLResolveInfo;
|
|
33
|
+
signal?: AbortSignal;
|
|
30
34
|
}
|
|
31
35
|
export interface GraphQLParseOptions {
|
|
32
36
|
noLocation?: boolean;
|
package/typings/Interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, GraphQLArgument, GraphQLArgumentConfig, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLEnumValueConfig, GraphQLError, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLIsTypeOfFn, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType,
|
|
1
|
+
import { DefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, GraphQLArgument, GraphQLArgumentConfig, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLEnumValueConfig, GraphQLError, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLIsTypeOfFn, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLScalarLiteralParser, GraphQLScalarSerializer, GraphQLScalarType, GraphQLScalarValueParser, GraphQLSchema, GraphQLType, GraphQLTypeResolver, GraphQLUnionType, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, GraphQLResolveInfo as OrigGraphQLResolveInfo, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SelectionNode, Source, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql';
|
|
2
2
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
3
3
|
/**
|
|
4
4
|
* The result of GraphQL execution.
|
|
@@ -18,6 +18,9 @@ export interface ExecutionResult<TData = any, TExtensions = any> {
|
|
|
18
18
|
path?: ReadonlyArray<string | number>;
|
|
19
19
|
items?: TData | null;
|
|
20
20
|
}
|
|
21
|
+
export interface GraphQLResolveInfo extends OrigGraphQLResolveInfo {
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
}
|
|
21
24
|
export interface ExecutionRequest<TVariables extends Record<string, any> = any, TContext = any, TRootValue = any, TExtensions = Record<string, any>, TReturn = any> {
|
|
22
25
|
document: TypedDocumentNode<TReturn, TVariables>;
|
|
23
26
|
variables?: TVariables;
|
|
@@ -27,6 +30,7 @@ export interface ExecutionRequest<TVariables extends Record<string, any> = any,
|
|
|
27
30
|
rootValue?: TRootValue;
|
|
28
31
|
context?: TContext;
|
|
29
32
|
info?: GraphQLResolveInfo;
|
|
33
|
+
signal?: AbortSignal;
|
|
30
34
|
}
|
|
31
35
|
export interface GraphQLParseOptions {
|
|
32
36
|
noLocation?: boolean;
|