@graphql-tools/utils 8.5.1 → 8.5.4

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.
@@ -8,3 +8,4 @@ interface AggregateErrorConstructor {
8
8
  }
9
9
  declare let AggregateErrorImpl: AggregateErrorConstructor;
10
10
  export { AggregateErrorImpl as AggregateError };
11
+ export declare function isAggregateError(error: Error): error is AggregateError;
package/executor.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ExecutionResult, ExecutionRequest } from './Interfaces';
2
2
  declare type MaybePromise<T> = Promise<T> | T;
3
- declare type MaybeAsyncIterableIterator<T> = AsyncIterableIterator<T> | T;
4
- export declare type AsyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => Promise<MaybeAsyncIterableIterator<ExecutionResult<TReturn>>>;
3
+ declare type MaybeAsyncIterable<T> = AsyncIterable<T> | T;
4
+ export declare type AsyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>;
5
5
  export declare type SyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => ExecutionResult<TReturn>;
6
- export declare type Executor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => MaybePromise<MaybeAsyncIterableIterator<ExecutionResult<TReturn>>>;
6
+ export declare type Executor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>;
7
7
  export {};
package/index.js CHANGED
@@ -69,9 +69,27 @@ function assertSome(input, message = 'Value should be something') {
69
69
  }
70
70
  }
71
71
 
72
+ if (typeof AggregateError === 'undefined') {
73
+ class AggregateErrorClass extends Error {
74
+ constructor(errors, message = '') {
75
+ super(message);
76
+ this.errors = errors;
77
+ this.name = 'AggregateError';
78
+ Error.captureStackTrace(this, AggregateErrorClass);
79
+ }
80
+ }
81
+ exports.AggregateError = function (errors, message) {
82
+ return new AggregateErrorClass(errors, message);
83
+ };
84
+ }
85
+ else {
86
+ exports.AggregateError = AggregateError;
87
+ }
88
+ function isAggregateError(error) {
89
+ return 'errors' in error && Array.isArray(error['errors']);
90
+ }
91
+
72
92
  // Taken from graphql-js
73
- // https://github.com/graphql/graphql-js/blob/main/src/jsutils/inspect.ts
74
- /* eslint-disable @typescript-eslint/ban-types */
75
93
  const MAX_ARRAY_LENGTH = 10;
76
94
  const MAX_RECURSIVE_DEPTH = 2;
77
95
  /**
@@ -92,10 +110,22 @@ function formatValue(value, seenValues) {
92
110
  return String(value);
93
111
  }
94
112
  }
113
+ function formatError(value) {
114
+ if (value instanceof graphql.GraphQLError) {
115
+ return value.toString();
116
+ }
117
+ return `${value.name}: ${value.message};\n ${value.stack}`;
118
+ }
95
119
  function formatObjectValue(value, previouslySeenValues) {
96
120
  if (value === null) {
97
121
  return 'null';
98
122
  }
123
+ if (value instanceof Error) {
124
+ if (isAggregateError(value)) {
125
+ return formatError(value) + '\n' + formatArray(value.errors, previouslySeenValues);
126
+ }
127
+ return formatError(value);
128
+ }
99
129
  if (previouslySeenValues.includes(value)) {
100
130
  return '[Circular]';
101
131
  }
@@ -176,7 +206,6 @@ function getArgumentValues(def, node, variableValues = {}) {
176
206
  [key]: value,
177
207
  }), {});
178
208
  const coercedValues = {};
179
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
180
209
  const argumentNodes = (_a = node.arguments) !== null && _a !== void 0 ? _a : [];
181
210
  const argNodeMap = argumentNodes.reduce((prev, arg) => ({
182
211
  ...prev,
@@ -1013,10 +1042,10 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
1013
1042
  const directives = directivesInExtensions
1014
1043
  ? makeDirectiveNodes(schema, directivesInExtensions)
1015
1044
  : ((_a = type.astNode) === null || _a === void 0 ? void 0 : _a.directives) || [];
1016
- if (type['specifiedByUrl'] &&
1017
- !directives.some(directiveNode => directiveNode.name.value === 'specifiedBy')) {
1045
+ const specifiedByValue = (type['specifiedByUrl'] || type['specifiedByURL']);
1046
+ if (specifiedByValue && !directives.some(directiveNode => directiveNode.name.value === 'specifiedBy')) {
1018
1047
  const specifiedByArgs = {
1019
- url: type['specifiedByUrl'],
1048
+ url: specifiedByValue,
1020
1049
  };
1021
1050
  directives.push(makeDirectiveNode('specifiedBy', specifiedByArgs));
1022
1051
  }
@@ -1164,21 +1193,6 @@ function makeDirectiveNodes(schema, directiveValues) {
1164
1193
  return directiveNodes;
1165
1194
  }
1166
1195
 
1167
- exports.AggregateError = globalThis.AggregateError;
1168
- if (typeof exports.AggregateError === 'undefined') {
1169
- class AggregateErrorClass extends Error {
1170
- constructor(errors, message = '') {
1171
- super(message);
1172
- this.errors = errors;
1173
- this.name = 'AggregateError';
1174
- Error.captureStackTrace(this, AggregateErrorClass);
1175
- }
1176
- }
1177
- exports.AggregateError = function (errors, message) {
1178
- return new AggregateErrorClass(errors, message);
1179
- };
1180
- }
1181
-
1182
1196
  async function validateGraphQlDocuments(schema, documentFiles, effectiveRules = createDefaultRules()) {
1183
1197
  const allFragmentMap = new Map();
1184
1198
  const documentFileObjectsToValidate = [];
@@ -3323,7 +3337,6 @@ function visitTypes(pruningContext, schema) {
3323
3337
  }
3324
3338
  }
3325
3339
 
3326
- // eslint-disable-next-line @typescript-eslint/ban-types
3327
3340
  function mergeDeep(sources, respectPrototype = false) {
3328
3341
  const target = sources[0] || {};
3329
3342
  const output = {};
@@ -4152,24 +4165,39 @@ function valueMatchesCriteria(value, criteria) {
4152
4165
  }
4153
4166
 
4154
4167
  function isAsyncIterable(value) {
4155
- return typeof value === 'object' && value != null && Symbol.asyncIterator in value;
4168
+ return (typeof value === 'object' &&
4169
+ value != null &&
4170
+ Symbol.asyncIterator in value &&
4171
+ typeof value[Symbol.asyncIterator] === 'function');
4156
4172
  }
4157
4173
 
4158
4174
  function isDocumentNode(object) {
4159
4175
  return object && typeof object === 'object' && 'kind' in object && object.kind === graphql.Kind.DOCUMENT;
4160
4176
  }
4161
4177
 
4162
- function withCancel(asyncIteratorLike, onCancel) {
4163
- const asyncIterator = asyncIteratorLike[Symbol.asyncIterator]();
4164
- if (!asyncIterator.return) {
4165
- asyncIterator.return = () => Promise.resolve({ value: undefined, done: true });
4166
- }
4167
- const savedReturn = asyncIterator.return.bind(asyncIterator);
4168
- asyncIterator.return = () => {
4169
- onCancel();
4170
- return savedReturn();
4171
- };
4172
- return asyncIterator;
4178
+ async function defaultReturn(value) {
4179
+ return { value, done: true };
4180
+ }
4181
+ function withCancel(asyncIterable, onCancel) {
4182
+ return new Proxy(asyncIterable, {
4183
+ get(asyncIterable, prop) {
4184
+ if (Symbol.asyncIterator === prop) {
4185
+ return function getAsyncIteratorWithCancel() {
4186
+ const asyncIterator = asyncIterable[Symbol.asyncIterator]();
4187
+ if (!asyncIterator.return) {
4188
+ asyncIterator.return = defaultReturn;
4189
+ }
4190
+ const savedReturn = asyncIterator.return.bind(asyncIterator);
4191
+ asyncIterator.return = async function extendedReturn(value) {
4192
+ const returnValue = await onCancel(value);
4193
+ return savedReturn(returnValue);
4194
+ };
4195
+ return asyncIterator;
4196
+ };
4197
+ }
4198
+ return asyncIterable[prop];
4199
+ },
4200
+ });
4173
4201
  }
4174
4202
 
4175
4203
  function buildFixedSchema(schema, options) {
@@ -4254,6 +4282,7 @@ exports.healSchema = healSchema;
4254
4282
  exports.healTypes = healTypes;
4255
4283
  exports.implementsAbstractType = implementsAbstractType;
4256
4284
  exports.inspect = inspect;
4285
+ exports.isAggregateError = isAggregateError;
4257
4286
  exports.isAsyncIterable = isAsyncIterable;
4258
4287
  exports.isDescribable = isDescribable;
4259
4288
  exports.isDocumentNode = isDocumentNode;
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { parse, isNonNullType, GraphQLError, Kind, valueFromAST, print, isObjectType, isListType, isSpecifiedDirective, astFromValue, isSpecifiedScalarType, isIntrospectionType, isInterfaceType, isUnionType, isInputObjectType, isEnumType, isScalarType, GraphQLDeprecatedDirective, specifiedRules, concatAST, validate, versionInfo, buildClientSchema, visit, TokenKind, Source, isTypeSystemDefinitionNode, getNamedType, GraphQLString, GraphQLNonNull, GraphQLList, GraphQLID, GraphQLBoolean, GraphQLFloat, GraphQLInt, GraphQLObjectType, GraphQLInterfaceType, GraphQLInputObjectType, GraphQLDirective, GraphQLUnionType, GraphQLEnumType, GraphQLScalarType, isNamedType, getNullableType, isLeafType, GraphQLSchema, isDirective, isCompositeType, doTypesOverlap, getOperationAST, getDirectiveValues, GraphQLSkipDirective, GraphQLIncludeDirective, typeFromAST, isAbstractType, getOperationRootType, TypeNameMetaFieldDef, buildASTSchema } from 'graphql';
1
+ import { parse, GraphQLError, isNonNullType, Kind, valueFromAST, print, isObjectType, isListType, isSpecifiedDirective, astFromValue, isSpecifiedScalarType, isIntrospectionType, isInterfaceType, isUnionType, isInputObjectType, isEnumType, isScalarType, GraphQLDeprecatedDirective, specifiedRules, concatAST, validate, versionInfo, buildClientSchema, visit, TokenKind, Source, isTypeSystemDefinitionNode, getNamedType, GraphQLString, GraphQLNonNull, GraphQLList, GraphQLID, GraphQLBoolean, GraphQLFloat, GraphQLInt, GraphQLObjectType, GraphQLInterfaceType, GraphQLInputObjectType, GraphQLDirective, GraphQLUnionType, GraphQLEnumType, GraphQLScalarType, isNamedType, getNullableType, isLeafType, GraphQLSchema, isDirective, isCompositeType, doTypesOverlap, getOperationAST, getDirectiveValues, GraphQLSkipDirective, GraphQLIncludeDirective, typeFromAST, isAbstractType, getOperationRootType, TypeNameMetaFieldDef, buildASTSchema } from 'graphql';
2
2
 
3
3
  const asArray = (fns) => (Array.isArray(fns) ? fns : fns ? [fns] : []);
4
4
  const invalidDocRegex = /\.[a-z0-9]+$/i;
@@ -65,9 +65,28 @@ function assertSome(input, message = 'Value should be something') {
65
65
  }
66
66
  }
67
67
 
68
+ let AggregateErrorImpl;
69
+ if (typeof AggregateError === 'undefined') {
70
+ class AggregateErrorClass extends Error {
71
+ constructor(errors, message = '') {
72
+ super(message);
73
+ this.errors = errors;
74
+ this.name = 'AggregateError';
75
+ Error.captureStackTrace(this, AggregateErrorClass);
76
+ }
77
+ }
78
+ AggregateErrorImpl = function (errors, message) {
79
+ return new AggregateErrorClass(errors, message);
80
+ };
81
+ }
82
+ else {
83
+ AggregateErrorImpl = AggregateError;
84
+ }
85
+ function isAggregateError(error) {
86
+ return 'errors' in error && Array.isArray(error['errors']);
87
+ }
88
+
68
89
  // Taken from graphql-js
69
- // https://github.com/graphql/graphql-js/blob/main/src/jsutils/inspect.ts
70
- /* eslint-disable @typescript-eslint/ban-types */
71
90
  const MAX_ARRAY_LENGTH = 10;
72
91
  const MAX_RECURSIVE_DEPTH = 2;
73
92
  /**
@@ -88,10 +107,22 @@ function formatValue(value, seenValues) {
88
107
  return String(value);
89
108
  }
90
109
  }
110
+ function formatError(value) {
111
+ if (value instanceof GraphQLError) {
112
+ return value.toString();
113
+ }
114
+ return `${value.name}: ${value.message};\n ${value.stack}`;
115
+ }
91
116
  function formatObjectValue(value, previouslySeenValues) {
92
117
  if (value === null) {
93
118
  return 'null';
94
119
  }
120
+ if (value instanceof Error) {
121
+ if (isAggregateError(value)) {
122
+ return formatError(value) + '\n' + formatArray(value.errors, previouslySeenValues);
123
+ }
124
+ return formatError(value);
125
+ }
95
126
  if (previouslySeenValues.includes(value)) {
96
127
  return '[Circular]';
97
128
  }
@@ -172,7 +203,6 @@ function getArgumentValues(def, node, variableValues = {}) {
172
203
  [key]: value,
173
204
  }), {});
174
205
  const coercedValues = {};
175
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
176
206
  const argumentNodes = (_a = node.arguments) !== null && _a !== void 0 ? _a : [];
177
207
  const argNodeMap = argumentNodes.reduce((prev, arg) => ({
178
208
  ...prev,
@@ -1009,10 +1039,10 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
1009
1039
  const directives = directivesInExtensions
1010
1040
  ? makeDirectiveNodes(schema, directivesInExtensions)
1011
1041
  : ((_a = type.astNode) === null || _a === void 0 ? void 0 : _a.directives) || [];
1012
- if (type['specifiedByUrl'] &&
1013
- !directives.some(directiveNode => directiveNode.name.value === 'specifiedBy')) {
1042
+ const specifiedByValue = (type['specifiedByUrl'] || type['specifiedByURL']);
1043
+ if (specifiedByValue && !directives.some(directiveNode => directiveNode.name.value === 'specifiedBy')) {
1014
1044
  const specifiedByArgs = {
1015
- url: type['specifiedByUrl'],
1045
+ url: specifiedByValue,
1016
1046
  };
1017
1047
  directives.push(makeDirectiveNode('specifiedBy', specifiedByArgs));
1018
1048
  }
@@ -1160,21 +1190,6 @@ function makeDirectiveNodes(schema, directiveValues) {
1160
1190
  return directiveNodes;
1161
1191
  }
1162
1192
 
1163
- let AggregateErrorImpl = globalThis.AggregateError;
1164
- if (typeof AggregateErrorImpl === 'undefined') {
1165
- class AggregateErrorClass extends Error {
1166
- constructor(errors, message = '') {
1167
- super(message);
1168
- this.errors = errors;
1169
- this.name = 'AggregateError';
1170
- Error.captureStackTrace(this, AggregateErrorClass);
1171
- }
1172
- }
1173
- AggregateErrorImpl = function (errors, message) {
1174
- return new AggregateErrorClass(errors, message);
1175
- };
1176
- }
1177
-
1178
1193
  async function validateGraphQlDocuments(schema, documentFiles, effectiveRules = createDefaultRules()) {
1179
1194
  const allFragmentMap = new Map();
1180
1195
  const documentFileObjectsToValidate = [];
@@ -3320,7 +3335,6 @@ function visitTypes(pruningContext, schema) {
3320
3335
  }
3321
3336
  }
3322
3337
 
3323
- // eslint-disable-next-line @typescript-eslint/ban-types
3324
3338
  function mergeDeep(sources, respectPrototype = false) {
3325
3339
  const target = sources[0] || {};
3326
3340
  const output = {};
@@ -4149,24 +4163,39 @@ function valueMatchesCriteria(value, criteria) {
4149
4163
  }
4150
4164
 
4151
4165
  function isAsyncIterable(value) {
4152
- return typeof value === 'object' && value != null && Symbol.asyncIterator in value;
4166
+ return (typeof value === 'object' &&
4167
+ value != null &&
4168
+ Symbol.asyncIterator in value &&
4169
+ typeof value[Symbol.asyncIterator] === 'function');
4153
4170
  }
4154
4171
 
4155
4172
  function isDocumentNode(object) {
4156
4173
  return object && typeof object === 'object' && 'kind' in object && object.kind === Kind.DOCUMENT;
4157
4174
  }
4158
4175
 
4159
- function withCancel(asyncIteratorLike, onCancel) {
4160
- const asyncIterator = asyncIteratorLike[Symbol.asyncIterator]();
4161
- if (!asyncIterator.return) {
4162
- asyncIterator.return = () => Promise.resolve({ value: undefined, done: true });
4163
- }
4164
- const savedReturn = asyncIterator.return.bind(asyncIterator);
4165
- asyncIterator.return = () => {
4166
- onCancel();
4167
- return savedReturn();
4168
- };
4169
- return asyncIterator;
4176
+ async function defaultReturn(value) {
4177
+ return { value, done: true };
4178
+ }
4179
+ function withCancel(asyncIterable, onCancel) {
4180
+ return new Proxy(asyncIterable, {
4181
+ get(asyncIterable, prop) {
4182
+ if (Symbol.asyncIterator === prop) {
4183
+ return function getAsyncIteratorWithCancel() {
4184
+ const asyncIterator = asyncIterable[Symbol.asyncIterator]();
4185
+ if (!asyncIterator.return) {
4186
+ asyncIterator.return = defaultReturn;
4187
+ }
4188
+ const savedReturn = asyncIterator.return.bind(asyncIterator);
4189
+ asyncIterator.return = async function extendedReturn(value) {
4190
+ const returnValue = await onCancel(value);
4191
+ return savedReturn(returnValue);
4192
+ };
4193
+ return asyncIterator;
4194
+ };
4195
+ }
4196
+ return asyncIterable[prop];
4197
+ },
4198
+ });
4170
4199
  }
4171
4200
 
4172
4201
  function buildFixedSchema(schema, options) {
@@ -4190,4 +4219,4 @@ function fixSchemaAst(schema, options) {
4190
4219
  return schema;
4191
4220
  }
4192
4221
 
4193
- export { AggregateErrorImpl as AggregateError, MapperKind, addTypes, appendObjectFields, asArray, assertSome, astFromArg, astFromDirective, astFromEnumType, astFromEnumValue, astFromField, astFromInputField, astFromInputObjectType, astFromInterfaceType, astFromObjectType, astFromScalarType, astFromSchema, astFromUnionType, astFromValueUntyped, buildOperationNodeForField, checkValidationErrors, collectComment, collectFields, collectSubFields, compareNodes, compareStrings, correctASTNodes, createDefaultRules, createNamedStub, createStub, createVariableNameGenerator, dedentBlockStringValue, filterSchema, fixSchemaAst, forEachDefaultValue, forEachField, getArgumentValues, getBlockStringIndentation, getBuiltInForStub, getComment, getDefinedRootType, getDeprecatableDirectiveNodes, getDescription, getDirective, getDirectiveInExtensions, getDirectiveNodes, getDirectives, getDirectivesInExtensions, getDocumentNodeFromSchema, getFieldsWithDirectives, getImplementingTypes, getLeadingCommentBlock, getOperationASTFromDocument, getOperationASTFromRequest, getResolversFromSchema, getResponseKeyFromInfo, getRootTypeMap, getRootTypeNames, getRootTypes, healSchema, healTypes, implementsAbstractType, inspect, isAsyncIterable, isDescribable, isDocumentNode, isDocumentString, isNamedStub, isSome, isValidPath, makeDeprecatedDirective, makeDirectiveNode, makeDirectiveNodes, mapAsyncIterator, mapSchema, memoize1, memoize2, memoize2of4, memoize3, memoize4, memoize5, mergeDeep, modifyObjectFields, nodeToString, observableToAsyncIterable, parseGraphQLJSON, parseGraphQLSDL, parseInputValue, parseInputValueLiteral, parseSelectionSet, printComment, printSchemaWithDirectives, printWithComments, pruneSchema, pushComment, relocatedError, removeObjectFields, renameType, resetComments, rewireTypes, selectObjectFields, serializeInputValue, transformCommentsToDescriptions, transformInputValue, updateArgument, validateGraphQlDocuments, valueMatchesCriteria, visitData, visitErrors, visitResult, withCancel };
4222
+ export { AggregateErrorImpl as AggregateError, MapperKind, addTypes, appendObjectFields, asArray, assertSome, astFromArg, astFromDirective, astFromEnumType, astFromEnumValue, astFromField, astFromInputField, astFromInputObjectType, astFromInterfaceType, astFromObjectType, astFromScalarType, astFromSchema, astFromUnionType, astFromValueUntyped, buildOperationNodeForField, checkValidationErrors, collectComment, collectFields, collectSubFields, compareNodes, compareStrings, correctASTNodes, createDefaultRules, createNamedStub, createStub, createVariableNameGenerator, dedentBlockStringValue, filterSchema, fixSchemaAst, forEachDefaultValue, forEachField, getArgumentValues, getBlockStringIndentation, getBuiltInForStub, getComment, getDefinedRootType, getDeprecatableDirectiveNodes, getDescription, getDirective, getDirectiveInExtensions, getDirectiveNodes, getDirectives, getDirectivesInExtensions, getDocumentNodeFromSchema, getFieldsWithDirectives, getImplementingTypes, getLeadingCommentBlock, getOperationASTFromDocument, getOperationASTFromRequest, getResolversFromSchema, getResponseKeyFromInfo, getRootTypeMap, getRootTypeNames, getRootTypes, healSchema, healTypes, implementsAbstractType, inspect, isAggregateError, isAsyncIterable, isDescribable, isDocumentNode, isDocumentString, isNamedStub, isSome, isValidPath, makeDeprecatedDirective, makeDirectiveNode, makeDirectiveNodes, mapAsyncIterator, mapSchema, memoize1, memoize2, memoize2of4, memoize3, memoize4, memoize5, mergeDeep, modifyObjectFields, nodeToString, observableToAsyncIterable, parseGraphQLJSON, parseGraphQLSDL, parseInputValue, parseInputValueLiteral, parseSelectionSet, printComment, printSchemaWithDirectives, printWithComments, pruneSchema, pushComment, relocatedError, removeObjectFields, renameType, resetComments, rewireTypes, selectObjectFields, serializeInputValue, transformCommentsToDescriptions, transformInputValue, updateArgument, validateGraphQlDocuments, valueMatchesCriteria, visitData, visitErrors, visitResult, withCancel };
@@ -1 +1 @@
1
- export declare function isAsyncIterable<T>(value: any): value is AsyncIterableIterator<T>;
1
+ export declare function isAsyncIterable<T>(value: any): value is AsyncIterable<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/utils",
3
- "version": "8.5.1",
3
+ "version": "8.5.4",
4
4
  "description": "Common package containing utils and types for GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
package/withCancel.d.ts CHANGED
@@ -1,3 +1 @@
1
- export declare function withCancel<T>(asyncIteratorLike: {
2
- [Symbol.asyncIterator](): AsyncIterator<T>;
3
- }, onCancel: () => void): AsyncIterator<T | undefined>;
1
+ export declare function withCancel<T>(asyncIterable: AsyncIterable<T>, onCancel: (value?: any) => void | Promise<void>): AsyncIterable<T | undefined>;