Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql

Package Overview
Dependencies
Maintainers
7
Versions
260
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql - npm Package Compare versions

Comparing version 16.3.0 to 16.8.1

8

error/GraphQLError.d.ts

@@ -17,3 +17,3 @@ import type { Maybe } from '../jsutils/Maybe';

}
export interface GraphQLErrorArgs {
export interface GraphQLErrorOptions {
nodes?: ReadonlyArray<ASTNode> | ASTNode | null;

@@ -79,4 +79,5 @@ source?: Maybe<Source>;

readonly extensions: GraphQLErrorExtensions;
constructor(message: string, options?: GraphQLErrorOptions);
/**
* @deprecated Please use the `GraphQLErrorArgs` constructor overload instead.
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
*/

@@ -96,3 +97,2 @@ constructor(

);
constructor(message: string, args?: GraphQLErrorArgs);
get [Symbol.toStringTag](): string;

@@ -143,4 +143,4 @@ toString(): string;

*
* @deprecated Please use `error.toString` instead. Will be removed in v17
* @deprecated Please use `error.toJSON` instead. Will be removed in v17
*/
export declare function formatError(error: GraphQLError): GraphQLFormattedError;

@@ -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);

@@ -265,3 +265,3 @@ this.name = 'GraphQLError';

*
* @deprecated Please use `error.toString` instead. Will be removed in v17
* @deprecated Please use `error.toJSON` instead. Will be removed in v17
*/

@@ -268,0 +268,0 @@

export { GraphQLError, printError, formatError } from './GraphQLError';
export type {
GraphQLErrorOptions,
GraphQLFormattedError,

@@ -4,0 +5,0 @@ GraphQLErrorExtensions,

@@ -26,12 +26,12 @@ 'use strict';

return new _GraphQLError.GraphQLError(
originalError.message,
(_nodes = originalError.nodes) !== null && _nodes !== void 0
? _nodes
: nodes,
originalError.source,
originalError.positions,
return new _GraphQLError.GraphQLError(originalError.message, {
nodes:
(_nodes = originalError.nodes) !== null && _nodes !== void 0
? _nodes
: nodes,
source: originalError.source,
positions: originalError.positions,
path,
originalError,
);
});
}

@@ -38,0 +38,0 @@

@@ -15,8 +15,6 @@ 'use strict';

function syntaxError(source, position, description) {
return new _GraphQLError.GraphQLError(
`Syntax Error: ${description}`,
undefined,
return new _GraphQLError.GraphQLError(`Syntax Error: ${description}`, {
source,
[position],
);
positions: [position],
});
}

@@ -327,3 +327,5 @@ 'use strict';

`Schema is not configured to execute ${operation.operation} operation.`,
operation,
{
nodes: operation,
},
);

@@ -410,19 +412,30 @@ }

for (const [responseName, fieldNodes] of fields.entries()) {
const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name);
const result = executeField(
exeContext,
parentType,
sourceValue,
fieldNodes,
fieldPath,
);
try {
for (const [responseName, fieldNodes] of fields.entries()) {
const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name);
const result = executeField(
exeContext,
parentType,
sourceValue,
fieldNodes,
fieldPath,
);
if (result !== undefined) {
results[responseName] = result;
if (result !== undefined) {
results[responseName] = result;
if ((0, _isPromise.isPromise)(result)) {
containsPromise = true;
if ((0, _isPromise.isPromise)(result)) {
containsPromise = true;
}
}
}
} catch (error) {
if (containsPromise) {
// Ensure that any promises returned by other fields are handled, as they may also reject.
return (0, _promiseForObject.promiseForObject)(results).finally(() => {
throw error;
});
}
throw error;
} // If there are no promises, we can just return the object

@@ -847,3 +860,5 @@

`Abstract type "${returnType.name}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`,
fieldNodes,
{
nodes: fieldNodes,
},
);

@@ -855,3 +870,5 @@ }

`Abstract type "${returnType.name}" was resolved to a non-object type "${runtimeTypeName}".`,
fieldNodes,
{
nodes: fieldNodes,
},
);

@@ -863,3 +880,5 @@ }

`Runtime Object type "${runtimeType.name}" is not a possible type for "${returnType.name}".`,
fieldNodes,
{
nodes: fieldNodes,
},
);

@@ -918,3 +937,5 @@ }

_inspect.inspect)(result)}.`,
fieldNodes,
{
nodes: fieldNodes,
},
);

@@ -921,0 +942,0 @@ }

@@ -14,2 +14,6 @@ export { pathToArray as responsePathAsArray } from '../jsutils/Path';

export { subscribe, createSourceEventStream } from './subscribe';
export { getVariableValues, getDirectiveValues } from './values';
export {
getArgumentValues,
getVariableValues,
getDirectiveValues,
} from './values';

@@ -36,2 +36,8 @@ 'use strict';

});
Object.defineProperty(exports, 'getArgumentValues', {
enumerable: true,
get: function () {
return _values.getArgumentValues;
},
});
Object.defineProperty(exports, 'getDirectiveValues', {

@@ -38,0 +44,0 @@ enumerable: true,

@@ -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.

@@ -197,3 +176,5 @@ if (!('schema' in exeContext)) {

'Schema is not configured to execute subscription operation.',
operation,
{
nodes: operation,
},
);

@@ -216,3 +197,5 @@ }

`The subscription field "${fieldName}" is not defined.`,
fieldNodes,
{
nodes: fieldNodes,
},
);

@@ -219,0 +202,0 @@ }

@@ -49,4 +49,2 @@ import type { Maybe } from '../jsutils/Maybe';

* Object prototype.
*
* @internal
*/

@@ -53,0 +51,0 @@ export declare function getArgumentValues(

@@ -88,3 +88,5 @@ 'use strict';

`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`,
varDefNode.type,
{
nodes: varDefNode.type,
},
),

@@ -106,3 +108,5 @@ );

`Variable "$${varName}" of required type "${varTypeStr}" was not provided.`,
varDefNode,
{
nodes: varDefNode,
},
),

@@ -122,3 +126,5 @@ );

`Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`,
varDefNode,
{
nodes: varDefNode,
},
),

@@ -144,10 +150,6 @@ );

onError(
new _GraphQLError.GraphQLError(
prefix + '; ' + error.message,
varDefNode,
undefined,
undefined,
undefined,
error.originalError,
),
new _GraphQLError.GraphQLError(prefix + '; ' + error.message, {
nodes: varDefNode,
originalError: error,
}),
);

@@ -167,4 +169,2 @@ },

* Object prototype.
*
* @internal
*/

@@ -201,3 +201,5 @@

)}" ` + 'was not provided.',
node,
{
nodes: node,
},
);

@@ -227,3 +229,5 @@ }

`was provided the variable "$${variableName}" which was not provided a runtime value.`,
valueNode,
{
nodes: valueNode,
},
);

@@ -243,3 +247,5 @@ }

)}" ` + 'must not be null.',
valueNode,
{
nodes: valueNode,
},
);

@@ -262,3 +268,5 @@ }

)}.`,
valueNode,
{
nodes: valueNode,
},
);

@@ -265,0 +273,0 @@ }

@@ -287,2 +287,3 @@ /**

responsePathAsArray,
getArgumentValues,
getVariableValues,

@@ -349,2 +350,3 @@ getDirectiveValues,

export type {
GraphQLErrorOptions,
GraphQLFormattedError,

@@ -351,0 +353,0 @@ GraphQLErrorExtensions,

@@ -744,2 +744,8 @@ 'use strict';

});
Object.defineProperty(exports, 'getArgumentValues', {
enumerable: true,
get: function () {
return _index3.getArgumentValues;
},
});
Object.defineProperty(exports, 'getDirectiveValues', {

@@ -746,0 +752,0 @@ enumerable: true,

@@ -17,5 +17,5 @@ 'use strict';

const instanceOf =
/* c8 ignore next 5 */
/* c8 ignore next 6 */
// FIXME: https://github.com/graphql/graphql-js/issues/2317
process.env.NODE_ENV === 'production'
globalThis.process && globalThis.process.env.NODE_ENV === 'production'
? function instanceOf(value, constructor) {

@@ -22,0 +22,0 @@ return value instanceof constructor;

@@ -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.
*/

@@ -68,2 +68,10 @@ import type { Maybe } from '../jsutils/Maybe';

/**
* Parser CPU and memory usage is linear to the number of tokens in a document
* however in extreme cases it becomes quadratic due to memory exhaustion.
* Parsing happens before validation so even invalid queries can burn lots of
* CPU time and memory.
* To prevent this you can set a maximum number of tokens allowed within a document.
*/
maxTokens?: number | undefined;
/**
* @deprecated will be removed in the v17.0.0

@@ -91,3 +99,3 @@ *

source: string | Source,
options?: ParseOptions,
options?: ParseOptions | undefined,
): DocumentNode;

@@ -106,3 +114,3 @@ /**

source: string | Source,
options?: ParseOptions,
options?: ParseOptions | undefined,
): ValueNode;

@@ -115,3 +123,3 @@ /**

source: string | Source,
options?: ParseOptions,
options?: ParseOptions | undefined,
): ConstValueNode;

@@ -130,3 +138,3 @@ /**

source: string | Source,
options?: ParseOptions,
options?: ParseOptions | undefined,
): TypeNode;

@@ -145,4 +153,5 @@ /**

export declare class Parser {
protected _options: Maybe<ParseOptions>;
protected _options: ParseOptions;
protected _lexer: Lexer;
protected _tokenCounter: number;
constructor(source: string | Source, options?: ParseOptions);

@@ -560,2 +569,3 @@ /**

delimitedMany<T>(delimiterKind: TokenKind, parseFn: () => T): Array<T>;
advanceLexer(): void;
}

@@ -95,3 +95,3 @@ 'use strict';

class Parser {
constructor(source, options) {
constructor(source, options = {}) {
const sourceObj = (0, _source.isSource)(source)

@@ -102,2 +102,3 @@ ? source

this._options = options;
this._tokenCounter = 0;
}

@@ -437,4 +438,2 @@ /**

parseFragmentDefinition() {
var _this$_options;
const start = this._lexer.token;

@@ -445,7 +444,3 @@ this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes

if (
((_this$_options = this._options) === null || _this$_options === void 0
? void 0
: _this$_options.allowLegacyFragmentVariables) === true
) {
if (this._options.allowLegacyFragmentVariables === true) {
return this.node(start, {

@@ -511,4 +506,3 @@ kind: _kinds.Kind.FRAGMENT_DEFINITION,

case _tokenKind.TokenKind.INT:
this._lexer.advance();
this.advanceLexer();
return this.node(token, {

@@ -520,4 +514,3 @@ kind: _kinds.Kind.INT,

case _tokenKind.TokenKind.FLOAT:
this._lexer.advance();
this.advanceLexer();
return this.node(token, {

@@ -533,3 +526,3 @@ kind: _kinds.Kind.FLOAT,

case _tokenKind.TokenKind.NAME:
this._lexer.advance();
this.advanceLexer();

@@ -590,5 +583,3 @@ switch (token.value) {

const token = this._lexer.token;
this._lexer.advance();
this.advanceLexer();
return this.node(token, {

@@ -1384,9 +1375,3 @@ kind: _kinds.Kind.STRING,

node(startToken, node) {
var _this$_options2;
if (
((_this$_options2 = this._options) === null || _this$_options2 === void 0
? void 0
: _this$_options2.noLocation) !== true
) {
if (this._options.noLocation !== true) {
node.loc = new _ast.Location(

@@ -1417,4 +1402,3 @@ startToken,

if (token.kind === kind) {
this._lexer.advance();
this.advanceLexer();
return token;

@@ -1438,4 +1422,3 @@ }

if (token.kind === kind) {
this._lexer.advance();
this.advanceLexer();
return true;

@@ -1455,3 +1438,3 @@ }

if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) {
this._lexer.advance();
this.advanceLexer();
} else {

@@ -1474,4 +1457,3 @@ throw (0, _syntaxError.syntaxError)(

if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) {
this._lexer.advance();
this.advanceLexer();
return true;

@@ -1563,2 +1545,20 @@ }

}
advanceLexer() {
const { maxTokens } = this._options;
const token = this._lexer.advance();
if (maxTokens !== undefined && token.kind !== _tokenKind.TokenKind.EOF) {
++this._tokenCounter;
if (this._tokenCounter > maxTokens) {
throw (0, _syntaxError.syntaxError)(
this._lexer.source,
token.start,
`Document contains more that ${maxTokens} tokens. Parsing aborted.`,
);
}
}
}
}

@@ -1565,0 +1565,0 @@ /**

@@ -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.3.0",
"version": "16.8.1",
"description": "A Query Language and Runtime which can target any service.",

@@ -34,3 +34,3 @@ "license": "MIT",

"engines": {
"node": "^12.22.0 || ^14.16.0 || >=16.0.0"
"node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
},

@@ -37,0 +37,0 @@ "publishConfig": {

@@ -305,6 +305,5 @@ import type { Maybe } from '../jsutils/Maybe';

*
* If a type's serialize function does not return a value (i.e. it returns
* `undefined`) then an error will be raised and a `null` value will be returned
* in the response. If the serialize function returns `null`, then no error will
* be included in the response.
* If a type's serialize function returns `null` or does not return a value
* (i.e. it returns `undefined`) then an error will be raised and a `null`
* value will be returned in the response. It is always better to validate
*

@@ -317,5 +316,12 @@ * Example:

* serialize(value) {
* if (value % 2 === 1) {
* return value;
* if (!Number.isFinite(value)) {
* throw new Error(
* `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`,
* );
* }
*
* if (value % 2 === 0) {
* throw new Error(`Scalar "Odd" cannot represent "${value}" since it is even.`);
* }
* return value;
* }

@@ -322,0 +328,0 @@ * });

@@ -523,6 +523,5 @@ 'use strict';

*
* If a type's serialize function does not return a value (i.e. it returns
* `undefined`) then an error will be raised and a `null` value will be returned
* in the response. If the serialize function returns `null`, then no error will
* be included in the response.
* If a type's serialize function returns `null` or does not return a value
* (i.e. it returns `undefined`) then an error will be raised and a `null`
* value will be returned in the response. It is always better to validate
*

@@ -535,5 +534,12 @@ * Example:

* serialize(value) {
* if (value % 2 === 1) {
* return value;
* if (!Number.isFinite(value)) {
* throw new Error(
* `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`,
* );
* }
*
* if (value % 2 === 0) {
* throw new Error(`Scalar "Odd" cannot represent "${value}" since it is even.`);
* }
* return value;
* }

@@ -1139,3 +1145,5 @@ * });

didYouMeanEnumValue(this, valueStr),
valueNode,
{
nodes: valueNode,
},
);

@@ -1151,3 +1159,5 @@ }

didYouMeanEnumValue(this, valueStr),
valueNode,
{
nodes: valueNode,
},
);

@@ -1154,0 +1164,0 @@ }

@@ -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 @@

@@ -102,3 +102,5 @@ 'use strict';

)}`,
valueNode,
{
nodes: valueNode,
},
);

@@ -112,3 +114,5 @@ }

`Int cannot represent non 32-bit signed integer value: ${valueNode.value}`,
valueNode,
{
nodes: valueNode,
},
);

@@ -223,3 +227,5 @@ }

)}`,
valueNode,
{
nodes: valueNode,
},
);

@@ -272,3 +278,5 @@ }

)}`,
valueNode,
{
nodes: valueNode,
},
);

@@ -324,3 +332,5 @@ }

(0, _printer.print)(valueNode),
valueNode,
{
nodes: valueNode,
},
);

@@ -327,0 +337,0 @@ }

@@ -72,3 +72,7 @@ 'use strict';

this._errors.push(new _GraphQLError.GraphQLError(message, _nodes));
this._errors.push(
new _GraphQLError.GraphQLError(message, {
nodes: _nodes,
}),
);
}

@@ -75,0 +79,0 @@

@@ -161,7 +161,5 @@ 'use strict';

`Expected type "${type.name}". ` + error.message,
undefined,
undefined,
undefined,
undefined,
error,
{
originalError: error,
},
),

@@ -168,0 +166,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 @@

@@ -125,2 +125,10 @@ 'use strict';

name
ofType {
kind
name
ofType {
kind
name
}
}
}

@@ -127,0 +135,0 @@ }

@@ -22,3 +22,5 @@ 'use strict';

'Schema does not define the required query root type.',
operation,
{
nodes: operation,
},
);

@@ -36,3 +38,5 @@ }

'Schema is not configured for mutations.',
operation,
{
nodes: operation,
},
);

@@ -50,3 +54,5 @@ }

'Schema is not configured for subscriptions.',
operation,
{
nodes: operation,
},
);

@@ -60,4 +66,6 @@ }

'Can only have query, mutation and subscription operations.',
operation,
{
nodes: operation,
},
);
}

@@ -39,3 +39,5 @@ 'use strict';

`The field ${parentType.name}.${fieldDef.name} is deprecated. ${deprecationReason}`,
node,
{
nodes: node,
},
),

@@ -60,3 +62,5 @@ );

`Directive "@${directiveDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`,
node,
{
nodes: node,
},
),

@@ -72,3 +76,5 @@ );

`Field "${parentType.name}.${fieldDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`,
node,
{
nodes: node,
},
),

@@ -96,3 +102,5 @@ );

`The input field ${inputObjectDef.name}.${inputFieldDef.name} is deprecated. ${deprecationReason}`,
node,
{
nodes: node,
},
),

@@ -119,3 +127,5 @@ );

`The enum value "${enumTypeDef.name}.${enumValueDef.name}" is deprecated. ${deprecationReason}`,
node,
{
nodes: node,
},
),

@@ -122,0 +132,0 @@ );

@@ -33,3 +33,5 @@ 'use strict';

`GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`,
node,
{
nodes: node,
},
),

@@ -36,0 +38,0 @@ );

@@ -35,3 +35,5 @@ 'use strict';

`The ${defName} definition is not executable.`,
definition,
{
nodes: definition,
},
),

@@ -38,0 +40,0 @@ );

@@ -54,3 +54,5 @@ 'use strict';

suggestion,
node,
{
nodes: node,
},
),

@@ -57,0 +59,0 @@ );

@@ -41,3 +41,5 @@ 'use strict';

`Fragment cannot condition on non composite type "${typeStr}".`,
typeCondition,
{
nodes: typeCondition,
},
),

@@ -60,3 +62,5 @@ );

`Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`,
node.typeCondition,
{
nodes: node.typeCondition,
},
),

@@ -63,0 +67,0 @@ );

@@ -49,3 +49,5 @@ 'use strict';

(0, _didYouMean.didYouMean)(suggestions),
argNode,
{
nodes: argNode,
},
),

@@ -107,3 +109,5 @@ );

(0, _didYouMean.didYouMean)(suggestions),
argNode,
{
nodes: argNode,
},
),

@@ -110,0 +114,0 @@ );

@@ -56,3 +56,5 @@ 'use strict';

context.reportError(
new _GraphQLError.GraphQLError(`Unknown directive "@${name}".`, node),
new _GraphQLError.GraphQLError(`Unknown directive "@${name}".`, {
nodes: node,
}),
);

@@ -68,3 +70,5 @@ return;

`Directive "@${name}" may not be used on ${candidateLocation}.`,
node,
{
nodes: node,
},
),

@@ -71,0 +75,0 @@ );

@@ -28,3 +28,5 @@ 'use strict';

`Unknown fragment "${fragmentName}".`,
node.name,
{
nodes: node.name,
},
),

@@ -31,0 +33,0 @@ );

@@ -68,3 +68,5 @@ 'use strict';

(0, _didYouMean.didYouMean)(suggestedTypes),
node,
{
nodes: node,
},
),

@@ -71,0 +73,0 @@ );

@@ -34,3 +34,5 @@ 'use strict';

'This anonymous operation must be the only defined operation.',
node,
{
nodes: node,
},
),

@@ -37,0 +39,0 @@ );

@@ -45,3 +45,5 @@ 'use strict';

'Cannot define a new schema within a schema extension.',
node,
{
nodes: node,
},
),

@@ -56,3 +58,5 @@ );

'Must provide only one schema definition.',
node,
{
nodes: node,
},
),

@@ -59,0 +63,0 @@ );

@@ -73,3 +73,5 @@ 'use strict';

(viaPath !== '' ? ` via ${viaPath}.` : '.'),
cyclePath,
{
nodes: cyclePath,
},
),

@@ -76,0 +78,0 @@ );

@@ -38,3 +38,5 @@ 'use strict';

: `Variable "$${varName}" is not defined.`,
[node, operation],
{
nodes: [node, operation],
},
),

@@ -41,0 +43,0 @@ );

@@ -51,3 +51,5 @@ 'use strict';

`Fragment "${fragName}" is never used.`,
fragmentDef,
{
nodes: fragmentDef,
},
),

@@ -54,0 +56,0 @@ );

@@ -43,3 +43,5 @@ 'use strict';

: `Variable "$${variableName}" is never used.`,
variableDef,
{
nodes: variableDef,
},
),

@@ -46,0 +48,0 @@ );

@@ -69,3 +69,5 @@ 'use strict';

`Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`,
fields1.concat(fields2),
{
nodes: fields1.concat(fields2),
},
),

@@ -545,3 +547,3 @@ );

if (stringifyArguments(node1) !== stringifyArguments(node2)) {
if (!sameArguments(node1, node2)) {
return [

@@ -591,23 +593,36 @@ [responseName, 'they have differing arguments'],

function stringifyArguments(fieldNode) {
var _fieldNode$arguments;
function sameArguments(node1, node2) {
const args1 = node1.arguments;
const args2 = node2.arguments;
// FIXME https://github.com/graphql/graphql-js/issues/2203
const args =
if (args1 === undefined || args1.length === 0) {
return args2 === undefined || args2.length === 0;
}
if (args2 === undefined || args2.length === 0) {
return false;
}
/* c8 ignore next */
if (args1.length !== args2.length) {
/* c8 ignore next */
(_fieldNode$arguments = fieldNode.arguments) !== null &&
_fieldNode$arguments !== void 0
? _fieldNode$arguments
: [];
const inputObjectWithArgs = {
kind: _kinds.Kind.OBJECT,
fields: args.map((argNode) => ({
kind: _kinds.Kind.OBJECT_FIELD,
name: argNode.name,
value: argNode.value,
})),
};
return (0, _printer.print)(
(0, _sortValueNode.sortValueNode)(inputObjectWithArgs),
);
return false;
/* c8 ignore next */
}
const values2 = new Map(args2.map(({ name, value }) => [name.value, value]));
return args1.every((arg1) => {
const value1 = arg1.value;
const value2 = values2.get(arg1.name.value);
if (value2 === undefined) {
return false;
}
return stringifyValue(value1) === stringifyValue(value2);
});
}
function stringifyValue(value) {
return (0, _printer.print)((0, _sortValueNode.sortValueNode)(value));
} // Two types conflict if both types could not apply to a value simultaneously.

@@ -614,0 +629,0 @@ // Composite types are ignored as their individual field types will be compared

@@ -45,3 +45,5 @@ 'use strict';

`Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`,
node,
{
nodes: node,
},
),

@@ -71,3 +73,5 @@ );

`Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`,
node,
{
nodes: node,
},
),

@@ -74,0 +78,0 @@ );

@@ -67,3 +67,5 @@ 'use strict';

`Cannot extend non-${kindStr} type "${typeName}".`,
defNode ? [defNode, node] : node,
{
nodes: defNode ? [defNode, node] : node,
},
),

@@ -87,3 +89,5 @@ );

(0, _didYouMean.didYouMean)(suggestedTypes),
node.name,
{
nodes: node.name,
},
),

@@ -90,0 +94,0 @@ );

@@ -62,3 +62,5 @@ 'use strict';

`Field "${fieldDef.name}" argument "${argDef.name}" of type "${argTypeStr}" is required, but it was not provided.`,
fieldNode,
{
nodes: fieldNode,
},
),

@@ -144,3 +146,5 @@ );

`Directive "@${directiveName}" argument "${argName}" of type "${argType}" is required, but it was not provided.`,
directiveNode,
{
nodes: directiveNode,
},
),

@@ -147,0 +151,0 @@ );

@@ -34,3 +34,5 @@ 'use strict';

`Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`,
selectionSet,
{
nodes: selectionSet,
},
),

@@ -45,3 +47,5 @@ );

`Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`,
node,
{
nodes: node,
},
),

@@ -48,0 +52,0 @@ );

@@ -58,3 +58,5 @@ 'use strict';

: 'Anonymous Subscription must select only one top level field.',
extraFieldSelections,
{
nodes: extraFieldSelections,
},
),

@@ -74,3 +76,5 @@ );

: 'Anonymous Subscription must not select an introspection top level field.',
fieldNodes,
{
nodes: fieldNodes,
},
),

@@ -77,0 +81,0 @@ );

@@ -82,3 +82,5 @@ 'use strict';

`Argument "${parentName}(${argName}:)" can only be defined once.`,
argNodes.map((node) => node.name),
{
nodes: argNodes.map((node) => node.name),
},
),

@@ -85,0 +87,0 @@ );

@@ -47,3 +47,5 @@ 'use strict';

`There can be only one argument named "${argName}".`,
argNodes.map((node) => node.name),
{
nodes: argNodes.map((node) => node.name),
},
),

@@ -50,0 +52,0 @@ );

@@ -30,3 +30,5 @@ 'use strict';

`Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`,
node.name,
{
nodes: node.name,
},
),

@@ -41,3 +43,5 @@ );

`There can be only one directive named "@${directiveName}".`,
[knownDirectiveNames[directiveName], node.name],
{
nodes: [knownDirectiveNames[directiveName], node.name],
},
),

@@ -44,0 +48,0 @@ );

@@ -83,3 +83,5 @@ 'use strict';

`The directive "@${directiveName}" can only be used once at this location.`,
[seenDirectives[directiveName], directive],
{
nodes: [seenDirectives[directiveName], directive],
},
),

@@ -86,0 +88,0 @@ );

@@ -54,3 +54,5 @@ 'use strict';

`Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`,
valueDef.name,
{
nodes: valueDef.name,
},
),

@@ -62,3 +64,5 @@ );

`Enum value "${typeName}.${valueName}" can only be defined once.`,
[valueNames[valueName], valueDef.name],
{
nodes: [valueNames[valueName], valueDef.name],
},
),

@@ -65,0 +69,0 @@ );

@@ -54,3 +54,5 @@ 'use strict';

`Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`,
fieldDef.name,
{
nodes: fieldDef.name,
},
),

@@ -62,3 +64,5 @@ );

`Field "${typeName}.${fieldName}" can only be defined once.`,
[fieldNames[fieldName], fieldDef.name],
{
nodes: [fieldNames[fieldName], fieldDef.name],
},
),

@@ -65,0 +69,0 @@ );

@@ -29,3 +29,5 @@ 'use strict';

`There can be only one fragment named "${fragmentName}".`,
[knownFragmentNames[fragmentName], node.name],
{
nodes: [knownFragmentNames[fragmentName], node.name],
},
),

@@ -32,0 +34,0 @@ );

@@ -44,3 +44,5 @@ 'use strict';

`There can be only one input field named "${fieldName}".`,
[knownNames[fieldName], node.name],
{
nodes: [knownNames[fieldName], node.name],
},
),

@@ -47,0 +49,0 @@ );

@@ -28,3 +28,8 @@ 'use strict';

`There can be only one operation named "${operationName.value}".`,
[knownOperationNames[operationName.value], operationName],
{
nodes: [
knownOperationNames[operationName.value],
operationName,
],
},
),

@@ -31,0 +36,0 @@ );

@@ -50,3 +50,5 @@ 'use strict';

`Type for ${operation} already defined in the schema. It cannot be redefined.`,
operationType,
{
nodes: operationType,
},
),

@@ -58,3 +60,5 @@ );

`There can be only one ${operation} type in schema.`,
[alreadyDefinedOperationType, operationType],
{
nodes: [alreadyDefinedOperationType, operationType],
},
),

@@ -61,0 +65,0 @@ );

@@ -34,3 +34,5 @@ 'use strict';

`Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`,
node.name,
{
nodes: node.name,
},
),

@@ -45,3 +47,5 @@ );

`There can be only one type named "${typeName}".`,
[knownTypeNames[typeName], node.name],
{
nodes: [knownTypeNames[typeName], node.name],
},
),

@@ -48,0 +52,0 @@ );

@@ -40,3 +40,5 @@ 'use strict';

`There can be only one variable named "$${variableName}".`,
variableNodes.map((node) => node.variable.name),
{
nodes: variableNodes.map((node) => node.variable.name),
},
),

@@ -43,0 +45,0 @@ );

@@ -66,3 +66,5 @@ 'use strict';

`Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`,
node,
{
nodes: node,
},
),

@@ -89,3 +91,5 @@ );

(0, _didYouMean.didYouMean)(suggestions),
node,
{
nodes: node,
},
),

@@ -105,3 +109,5 @@ );

)}", found ${(0, _printer.print)(node)}.`,
node,
{
nodes: node,
},
),

@@ -141,3 +147,5 @@ );

)}.`,
node,
{
nodes: node,
},
),

@@ -163,3 +171,5 @@ );

)}.`,
node,
{
nodes: node,
},
),

@@ -179,7 +189,6 @@ );

)}; ` + error.message,
node,
undefined,
undefined,
undefined,
error,
{
nodes: node,
originalError: error,
},
),

@@ -186,0 +195,0 @@ );

@@ -38,3 +38,5 @@ 'use strict';

`Variable "$${variableName}" cannot be non-input type "${typeName}".`,
node.type,
{
nodes: node.type,
},
),

@@ -41,0 +43,0 @@ );

@@ -66,3 +66,5 @@ 'use strict';

`Variable "$${varName}" of type "${varTypeStr}" used in position expecting type "${typeStr}".`,
[varDef, node],
{
nodes: [varDef, node],
},
),

@@ -69,0 +71,0 @@ );

@@ -13,3 +13,3 @@ 'use strict';

*/
const version = '16.3.0';
const version = '16.8.1';
/**

@@ -22,6 +22,6 @@ * An object containing the components of the GraphQL.js version string

major: 16,
minor: 3,
patch: 0,
minor: 8,
patch: 1,
preReleaseTag: null,
});
exports.versionInfo = versionInfo;

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

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

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

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

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc