Comparing version 16.4.0 to 16.5.0-canary.pr.3686.d9ad8e3fd58929d38deea522d794a6b22d3244b5
@@ -17,3 +17,3 @@ import type { Maybe } from '../jsutils/Maybe'; | ||
} | ||
export interface GraphQLErrorArgs { | ||
export interface GraphQLErrorOptions { | ||
nodes?: ReadonlyArray<ASTNode> | ASTNode | null; | ||
@@ -79,5 +79,5 @@ source?: Maybe<Source>; | ||
readonly extensions: GraphQLErrorExtensions; | ||
constructor(message: string, args?: GraphQLErrorArgs); | ||
constructor(message: string, options?: GraphQLErrorOptions); | ||
/** | ||
* @deprecated Please use the `GraphQLErrorArgs` constructor overload instead. | ||
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead. | ||
*/ | ||
@@ -84,0 +84,0 @@ constructor( |
@@ -16,3 +16,3 @@ 'use strict'; | ||
function toNormalizedArgs(args) { | ||
function toNormalizedOptions(args) { | ||
const firstArg = args[0]; | ||
@@ -84,3 +84,3 @@ | ||
/** | ||
* @deprecated Please use the `GraphQLErrorArgs` constructor overload instead. | ||
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead. | ||
*/ | ||
@@ -91,3 +91,3 @@ constructor(message, ...rawArgs) { | ||
const { nodes, source, positions, path, originalError, extensions } = | ||
toNormalizedArgs(rawArgs); | ||
toNormalizedOptions(rawArgs); | ||
super(message); | ||
@@ -94,0 +94,0 @@ this.name = 'GraphQLError'; |
export { GraphQLError, printError, formatError } from './GraphQLError'; | ||
export type { | ||
GraphQLErrorOptions, | ||
GraphQLFormattedError, | ||
@@ -4,0 +5,0 @@ GraphQLErrorExtensions, |
@@ -59,2 +59,6 @@ import type { Maybe } from '../jsutils/Maybe'; | ||
export declare function createSourceEventStream( | ||
args: ExecutionArgs, | ||
): Promise<AsyncIterable<unknown> | ExecutionResult>; | ||
/** @deprecated will be removed in next major version in favor of named arguments */ | ||
export declare function createSourceEventStream( | ||
schema: GraphQLSchema, | ||
@@ -61,0 +65,0 @@ document: DocumentNode, |
@@ -57,21 +57,3 @@ 'use strict'; | ||
); | ||
const { | ||
schema, | ||
document, | ||
rootValue, | ||
contextValue, | ||
variableValues, | ||
operationName, | ||
fieldResolver, | ||
subscribeFieldResolver, | ||
} = args; | ||
const resultOrStream = await createSourceEventStream( | ||
schema, | ||
document, | ||
rootValue, | ||
contextValue, | ||
variableValues, | ||
operationName, | ||
subscribeFieldResolver, | ||
); | ||
const resultOrStream = await createSourceEventStream(args); | ||
@@ -88,11 +70,3 @@ if (!(0, _isAsyncIterable.isAsyncIterable)(resultOrStream)) { | ||
const mapSourceToResponse = (payload) => | ||
(0, _execute.execute)({ | ||
schema, | ||
document, | ||
rootValue: payload, | ||
contextValue, | ||
variableValues, | ||
operationName, | ||
fieldResolver, | ||
}); // Map every source value to a ExecutionResult value as described above. | ||
(0, _execute.execute)({ ...args, rootValue: payload }); // Map every source value to a ExecutionResult value as described above. | ||
@@ -104,2 +78,21 @@ return (0, _mapAsyncIterator.mapAsyncIterator)( | ||
} | ||
function toNormalizedArgs(args) { | ||
const firstArg = args[0]; | ||
if (firstArg && 'document' in firstArg) { | ||
return firstArg; | ||
} | ||
return { | ||
schema: firstArg, | ||
// FIXME: when underlying TS bug fixed, see https://github.com/microsoft/TypeScript/issues/31613 | ||
document: args[1], | ||
rootValue: args[2], | ||
contextValue: args[3], | ||
variableValues: args[4], | ||
operationName: args[5], | ||
subscribeFieldResolver: args[6], | ||
}; | ||
} | ||
/** | ||
@@ -134,25 +127,11 @@ * Implements the "CreateSourceEventStream" algorithm described in the | ||
async function createSourceEventStream( | ||
schema, | ||
document, | ||
rootValue, | ||
contextValue, | ||
variableValues, | ||
operationName, | ||
subscribeFieldResolver, | ||
) { | ||
// If arguments are missing or incorrectly typed, this is an internal | ||
async function createSourceEventStream(...rawArgs) { | ||
const args = toNormalizedArgs(rawArgs); | ||
const { schema, document, variableValues } = args; // If arguments are missing or incorrectly typed, this is an internal | ||
// developer mistake which should throw an early error. | ||
(0, _execute.assertValidExecutionArguments)(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, | ||
// a "Response" with only errors is returned. | ||
const exeContext = (0, _execute.buildExecutionContext)({ | ||
schema, | ||
document, | ||
rootValue, | ||
contextValue, | ||
variableValues, | ||
operationName, | ||
subscribeFieldResolver, | ||
}); // Return early errors if execution context failed. | ||
const exeContext = (0, _execute.buildExecutionContext)(args); // Return early errors if execution context failed. | ||
@@ -159,0 +138,0 @@ if (!('schema' in exeContext)) { |
@@ -349,2 +349,3 @@ /** | ||
export type { | ||
GraphQLErrorOptions, | ||
GraphQLFormattedError, | ||
@@ -351,0 +352,0 @@ GraphQLErrorExtensions, |
@@ -182,3 +182,3 @@ import type { Kind } from './kinds'; | ||
} | ||
export declare enum OperationTypeNode { | ||
declare enum OperationTypeNode { | ||
QUERY = 'query', | ||
@@ -188,2 +188,3 @@ MUTATION = 'mutation', | ||
} | ||
export { OperationTypeNode }; | ||
export interface VariableDefinitionNode { | ||
@@ -190,0 +191,0 @@ readonly kind: Kind.VARIABLE_DEFINITION; |
@@ -217,3 +217,3 @@ 'use strict'; | ||
let OperationTypeNode; | ||
var OperationTypeNode; | ||
exports.OperationTypeNode = OperationTypeNode; | ||
@@ -220,0 +220,0 @@ |
/** | ||
* The set of allowed directive location values. | ||
*/ | ||
export declare enum DirectiveLocation { | ||
declare enum DirectiveLocation { | ||
/** Request Definitions */ | ||
@@ -27,2 +27,3 @@ QUERY = 'QUERY', | ||
} | ||
export { DirectiveLocation }; | ||
/** | ||
@@ -29,0 +30,0 @@ * The enum type representing the directive location values. |
@@ -11,9 +11,3 @@ 'use strict'; | ||
*/ | ||
let DirectiveLocation; | ||
/** | ||
* The enum type representing the directive location values. | ||
* | ||
* @deprecated Please use `DirectiveLocation`. Will be remove in v17. | ||
*/ | ||
var DirectiveLocation; | ||
exports.DirectiveLocation = DirectiveLocation; | ||
@@ -42,1 +36,6 @@ | ||
})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {})); | ||
/** | ||
* The enum type representing the directive location values. | ||
* | ||
* @deprecated Please use `DirectiveLocation`. Will be remove in v17. | ||
*/ |
/** | ||
* The set of allowed kind values for AST nodes. | ||
*/ | ||
export declare enum Kind { | ||
declare enum Kind { | ||
/** Name */ | ||
@@ -60,2 +60,3 @@ NAME = 'Name', | ||
} | ||
export { Kind }; | ||
/** | ||
@@ -62,0 +63,0 @@ * The enum type representing the possible kind values of AST nodes. |
@@ -11,9 +11,3 @@ 'use strict'; | ||
*/ | ||
let Kind; | ||
/** | ||
* The enum type representing the possible kind values of AST nodes. | ||
* | ||
* @deprecated Please use `Kind`. Will be remove in v17. | ||
*/ | ||
var Kind; | ||
exports.Kind = Kind; | ||
@@ -66,1 +60,6 @@ | ||
})(Kind || (exports.Kind = Kind = {})); | ||
/** | ||
* The enum type representing the possible kind values of AST nodes. | ||
* | ||
* @deprecated Please use `Kind`. Will be remove in v17. | ||
*/ |
@@ -5,3 +5,3 @@ /** | ||
*/ | ||
export declare enum TokenKind { | ||
declare enum TokenKind { | ||
SOF = '<SOF>', | ||
@@ -30,2 +30,3 @@ EOF = '<EOF>', | ||
} | ||
export { TokenKind }; | ||
/** | ||
@@ -32,0 +33,0 @@ * The enum type representing the token kinds values. |
@@ -12,9 +12,3 @@ 'use strict'; | ||
*/ | ||
let TokenKind; | ||
/** | ||
* The enum type representing the token kinds values. | ||
* | ||
* @deprecated Please use `TokenKind`. Will be remove in v17. | ||
*/ | ||
var TokenKind; | ||
exports.TokenKind = TokenKind; | ||
@@ -46,1 +40,6 @@ | ||
})(TokenKind || (exports.TokenKind = TokenKind = {})); | ||
/** | ||
* The enum type representing the token kinds values. | ||
* | ||
* @deprecated Please use `TokenKind`. Will be remove in v17. | ||
*/ |
{ | ||
"name": "graphql", | ||
"version": "16.4.0", | ||
"version": "16.5.0-canary.pr.3686.d9ad8e3fd58929d38deea522d794a6b22d3244b5", | ||
"description": "A Query Language and Runtime which can target any service.", | ||
@@ -37,4 +37,5 @@ "license": "MIT", | ||
"publishConfig": { | ||
"tag": "latest" | ||
} | ||
} | ||
"tag": "canary-pr-3686" | ||
}, | ||
"deprecated": "You are using canary version build from https://github.com/graphql/graphql-js/pull/3686, no gurantees provided so please use your own discretion." | ||
} |
@@ -10,3 +10,3 @@ import type { GraphQLField, GraphQLNamedType } from './definition'; | ||
export declare const __EnumValue: GraphQLObjectType; | ||
export declare enum TypeKind { | ||
declare enum TypeKind { | ||
SCALAR = 'SCALAR', | ||
@@ -21,2 +21,3 @@ OBJECT = 'OBJECT', | ||
} | ||
export { TypeKind }; | ||
export declare const __TypeKind: GraphQLEnumType; | ||
@@ -23,0 +24,0 @@ /** |
@@ -496,3 +496,3 @@ 'use strict'; | ||
exports.__EnumValue = __EnumValue; | ||
let TypeKind; | ||
var TypeKind; | ||
exports.TypeKind = TypeKind; | ||
@@ -499,0 +499,0 @@ |
import type { GraphQLSchema } from '../type/schema'; | ||
export declare enum BreakingChangeType { | ||
declare enum BreakingChangeType { | ||
TYPE_REMOVED = 'TYPE_REMOVED', | ||
@@ -20,3 +20,4 @@ TYPE_CHANGED_KIND = 'TYPE_CHANGED_KIND', | ||
} | ||
export declare enum DangerousChangeType { | ||
export { BreakingChangeType }; | ||
declare enum DangerousChangeType { | ||
VALUE_ADDED_TO_ENUM = 'VALUE_ADDED_TO_ENUM', | ||
@@ -29,2 +30,3 @@ TYPE_ADDED_TO_UNION = 'TYPE_ADDED_TO_UNION', | ||
} | ||
export { DangerousChangeType }; | ||
export interface BreakingChange { | ||
@@ -31,0 +33,0 @@ type: BreakingChangeType; |
@@ -26,3 +26,3 @@ 'use strict'; | ||
let BreakingChangeType; | ||
var BreakingChangeType; | ||
exports.BreakingChangeType = BreakingChangeType; | ||
@@ -56,3 +56,3 @@ | ||
let DangerousChangeType; | ||
var DangerousChangeType; | ||
exports.DangerousChangeType = DangerousChangeType; | ||
@@ -59,0 +59,0 @@ |
@@ -13,3 +13,3 @@ 'use strict'; | ||
*/ | ||
const version = '16.4.0'; | ||
const version = '16.5.0'; | ||
/** | ||
@@ -22,3 +22,3 @@ * An object containing the components of the GraphQL.js version string | ||
major: 16, | ||
minor: 4, | ||
minor: 5, | ||
patch: 0, | ||
@@ -25,0 +25,0 @@ preReleaseTag: null, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1338598
41725
1
1