@graphql-tools/utils 8.6.12-alpha-cdfcad8a.0 → 8.6.12-alpha-6669bfeb.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/errors.d.ts +3 -3
- package/index.js +14 -33
- package/index.mjs +14 -33
- package/package.json +1 -1
- package/createGraphQLError.d.ts +0 -14
package/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ASTNode, GraphQLError,
|
|
1
|
+
import { ASTNode, GraphQLError, Source } from 'graphql';
|
|
2
2
|
import { Maybe } from './types';
|
|
3
3
|
interface GraphQLErrorOptions {
|
|
4
4
|
nodes?: ReadonlyArray<ASTNode> | ASTNode | null;
|
|
@@ -8,8 +8,8 @@ interface GraphQLErrorOptions {
|
|
|
8
8
|
originalError?: Maybe<Error & {
|
|
9
9
|
readonly extensions?: unknown;
|
|
10
10
|
}>;
|
|
11
|
-
extensions?:
|
|
11
|
+
extensions?: any;
|
|
12
12
|
}
|
|
13
|
-
export declare function createGraphQLError(message: string, options
|
|
13
|
+
export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError;
|
|
14
14
|
export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>): GraphQLError;
|
|
15
15
|
export {};
|
package/index.js
CHANGED
|
@@ -70,16 +70,20 @@ function assertSome(input, message = 'Value should be something') {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function createGraphQLError(message, options) {
|
|
73
|
-
if (graphql.versionInfo.major
|
|
74
|
-
|
|
75
|
-
Object.defineProperty(error, 'extensions', {
|
|
76
|
-
value: options.extensions || {},
|
|
77
|
-
});
|
|
78
|
-
return error;
|
|
73
|
+
if (graphql.versionInfo.major >= 17) {
|
|
74
|
+
return new graphql.GraphQLError(message, options);
|
|
79
75
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
return new graphql.GraphQLError(message, options === null || options === void 0 ? void 0 : options.nodes, options === null || options === void 0 ? void 0 : options.source, options === null || options === void 0 ? void 0 : options.positions, options === null || options === void 0 ? void 0 : options.path, options === null || options === void 0 ? void 0 : options.originalError, options === null || options === void 0 ? void 0 : options.extensions);
|
|
77
|
+
}
|
|
78
|
+
function relocatedError(originalError, path) {
|
|
79
|
+
return createGraphQLError(originalError.message, {
|
|
80
|
+
nodes: originalError.nodes,
|
|
81
|
+
source: originalError.source,
|
|
82
|
+
positions: originalError.positions,
|
|
83
|
+
path: path == null ? originalError.path : path,
|
|
84
|
+
originalError,
|
|
85
|
+
extensions: originalError.extensions,
|
|
86
|
+
});
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
if (typeof AggregateError === 'undefined') {
|
|
@@ -3803,29 +3807,6 @@ function implementsAbstractType(schema, typeA, typeB) {
|
|
|
3803
3807
|
return false;
|
|
3804
3808
|
}
|
|
3805
3809
|
|
|
3806
|
-
function createGraphQLError$1(message, options) {
|
|
3807
|
-
if (graphql.versionInfo.major > 15) {
|
|
3808
|
-
const error = new graphql.GraphQLError(message, options);
|
|
3809
|
-
Object.defineProperty(error, 'extensions', {
|
|
3810
|
-
value: options.extensions || {},
|
|
3811
|
-
});
|
|
3812
|
-
return error;
|
|
3813
|
-
}
|
|
3814
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3815
|
-
// @ts-ignore
|
|
3816
|
-
return new graphql.GraphQLError(message, options.nodes, options.source, options.positions, options.path, options.originalError, options.extensions);
|
|
3817
|
-
}
|
|
3818
|
-
function relocatedError(originalError, path) {
|
|
3819
|
-
return createGraphQLError$1(originalError.message, {
|
|
3820
|
-
nodes: originalError.nodes,
|
|
3821
|
-
source: originalError.source,
|
|
3822
|
-
positions: originalError.positions,
|
|
3823
|
-
path: path == null ? originalError.path : path,
|
|
3824
|
-
originalError,
|
|
3825
|
-
extensions: originalError.extensions,
|
|
3826
|
-
});
|
|
3827
|
-
}
|
|
3828
|
-
|
|
3829
3810
|
function observableToAsyncIterable(observable) {
|
|
3830
3811
|
const pullQueue = [];
|
|
3831
3812
|
const pushQueue = [];
|
|
@@ -4349,7 +4330,7 @@ exports.compareNodes = compareNodes;
|
|
|
4349
4330
|
exports.compareStrings = compareStrings;
|
|
4350
4331
|
exports.correctASTNodes = correctASTNodes;
|
|
4351
4332
|
exports.createDefaultRules = createDefaultRules;
|
|
4352
|
-
exports.createGraphQLError = createGraphQLError
|
|
4333
|
+
exports.createGraphQLError = createGraphQLError;
|
|
4353
4334
|
exports.createNamedStub = createNamedStub;
|
|
4354
4335
|
exports.createStub = createStub;
|
|
4355
4336
|
exports.createVariableNameGenerator = createVariableNameGenerator;
|
package/index.mjs
CHANGED
|
@@ -66,16 +66,20 @@ function assertSome(input, message = 'Value should be something') {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
function createGraphQLError(message, options) {
|
|
69
|
-
if (versionInfo.major
|
|
70
|
-
|
|
71
|
-
Object.defineProperty(error, 'extensions', {
|
|
72
|
-
value: options.extensions || {},
|
|
73
|
-
});
|
|
74
|
-
return error;
|
|
69
|
+
if (versionInfo.major >= 17) {
|
|
70
|
+
return new GraphQLError(message, options);
|
|
75
71
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
return new GraphQLError(message, options === null || options === void 0 ? void 0 : options.nodes, options === null || options === void 0 ? void 0 : options.source, options === null || options === void 0 ? void 0 : options.positions, options === null || options === void 0 ? void 0 : options.path, options === null || options === void 0 ? void 0 : options.originalError, options === null || options === void 0 ? void 0 : options.extensions);
|
|
73
|
+
}
|
|
74
|
+
function relocatedError(originalError, path) {
|
|
75
|
+
return createGraphQLError(originalError.message, {
|
|
76
|
+
nodes: originalError.nodes,
|
|
77
|
+
source: originalError.source,
|
|
78
|
+
positions: originalError.positions,
|
|
79
|
+
path: path == null ? originalError.path : path,
|
|
80
|
+
originalError,
|
|
81
|
+
extensions: originalError.extensions,
|
|
82
|
+
});
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
let AggregateErrorImpl;
|
|
@@ -3802,29 +3806,6 @@ function implementsAbstractType(schema, typeA, typeB) {
|
|
|
3802
3806
|
return false;
|
|
3803
3807
|
}
|
|
3804
3808
|
|
|
3805
|
-
function createGraphQLError$1(message, options) {
|
|
3806
|
-
if (versionInfo.major > 15) {
|
|
3807
|
-
const error = new GraphQLError(message, options);
|
|
3808
|
-
Object.defineProperty(error, 'extensions', {
|
|
3809
|
-
value: options.extensions || {},
|
|
3810
|
-
});
|
|
3811
|
-
return error;
|
|
3812
|
-
}
|
|
3813
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3814
|
-
// @ts-ignore
|
|
3815
|
-
return new GraphQLError(message, options.nodes, options.source, options.positions, options.path, options.originalError, options.extensions);
|
|
3816
|
-
}
|
|
3817
|
-
function relocatedError(originalError, path) {
|
|
3818
|
-
return createGraphQLError$1(originalError.message, {
|
|
3819
|
-
nodes: originalError.nodes,
|
|
3820
|
-
source: originalError.source,
|
|
3821
|
-
positions: originalError.positions,
|
|
3822
|
-
path: path == null ? originalError.path : path,
|
|
3823
|
-
originalError,
|
|
3824
|
-
extensions: originalError.extensions,
|
|
3825
|
-
});
|
|
3826
|
-
}
|
|
3827
|
-
|
|
3828
3809
|
function observableToAsyncIterable(observable) {
|
|
3829
3810
|
const pullQueue = [];
|
|
3830
3811
|
const pushQueue = [];
|
|
@@ -4322,4 +4303,4 @@ function fixSchemaAst(schema, options) {
|
|
|
4322
4303
|
return schema;
|
|
4323
4304
|
}
|
|
4324
4305
|
|
|
4325
|
-
export { AggregateErrorImpl as AggregateError, DirectiveLocation, 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, createGraphQLError
|
|
4306
|
+
export { AggregateErrorImpl as AggregateError, DirectiveLocation, 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, createGraphQLError, createNamedStub, createStub, createVariableNameGenerator, dedentBlockStringValue, filterSchema, fixSchemaAst, forEachDefaultValue, forEachField, getArgumentValues, getAsyncIterableWithCancel, getAsyncIteratorWithCancel, 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, getAsyncIterableWithCancel as withCancel };
|
package/package.json
CHANGED
package/createGraphQLError.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ASTNode, GraphQLError, GraphQLErrorExtensions, Source } from 'graphql';
|
|
2
|
-
import { Maybe } from './types';
|
|
3
|
-
interface GraphQLErrorOptions {
|
|
4
|
-
nodes?: ReadonlyArray<ASTNode> | ASTNode | null;
|
|
5
|
-
source?: Maybe<Source>;
|
|
6
|
-
positions?: Maybe<ReadonlyArray<number>>;
|
|
7
|
-
path?: Maybe<ReadonlyArray<string | number>>;
|
|
8
|
-
originalError?: Maybe<Error & {
|
|
9
|
-
readonly extensions?: unknown;
|
|
10
|
-
}>;
|
|
11
|
-
extensions?: Maybe<GraphQLErrorExtensions>;
|
|
12
|
-
}
|
|
13
|
-
export declare function createGraphQLError(message: string, options: GraphQLErrorOptions): GraphQLError;
|
|
14
|
-
export {};
|