@graphql-ez/utils
Advanced tools
+14
| import { ASTNode, GraphQLError, Source } from 'graphql'; | ||
| type Maybe<T> = null | undefined | T; | ||
| interface GraphQLErrorOptions { | ||
| nodes?: ReadonlyArray<ASTNode> | ASTNode | null; | ||
| source?: Maybe<Source>; | ||
| positions?: Maybe<ReadonlyArray<number>>; | ||
| path?: Maybe<ReadonlyArray<string | number>>; | ||
| originalError?: Maybe<Error & { | ||
| readonly extensions?: unknown; | ||
| }>; | ||
| extensions?: any; | ||
| } | ||
| export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError; | ||
| export {}; |
+22
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| const graphql = require('graphql'); | ||
| function createGraphQLError(message, options) { | ||
| if (graphql.versionInfo.major >= 17) { | ||
| return new graphql.GraphQLError(message, options); | ||
| } | ||
| return new graphql.GraphQLError( | ||
| message, | ||
| options == null ? void 0 : options.nodes, | ||
| options == null ? void 0 : options.source, | ||
| options == null ? void 0 : options.positions, | ||
| options == null ? void 0 : options.path, | ||
| options == null ? void 0 : options.originalError, | ||
| options == null ? void 0 : options.extensions | ||
| ); | ||
| } | ||
| exports.createGraphQLError = createGraphQLError; |
+18
| import { versionInfo, GraphQLError } from 'graphql'; | ||
| function createGraphQLError(message, options) { | ||
| if (versionInfo.major >= 17) { | ||
| return new GraphQLError(message, options); | ||
| } | ||
| return new GraphQLError( | ||
| message, | ||
| options == null ? void 0 : options.nodes, | ||
| options == null ? void 0 : options.source, | ||
| options == null ? void 0 : options.positions, | ||
| options == null ? void 0 : options.path, | ||
| options == null ? void 0 : options.originalError, | ||
| options == null ? void 0 : options.extensions | ||
| ); | ||
| } | ||
| export { createGraphQLError }; |
+1
-1
| { | ||
| "name": "@graphql-ez/utils", | ||
| "version": "0.1.5", | ||
| "version": "0.2.0", | ||
| "sideEffects": false, | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
22125
8.57%29
11.54%586
8.92%