New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphql

Package Overview
Dependencies
Maintainers
7
Versions
271
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 17.0.0-alpha.2 to 17.0.0-alpha.2.canary.pr.3791.264f22163eb937ff87a420be9f7d45965f2cbf07

11

execution/execute.d.ts

@@ -60,2 +60,6 @@ import type { Maybe } from '../jsutils/Maybe.js';

subsequentPayloads: Set<AsyncPayloadRecord>;
signal: Maybe<{
isAborted: boolean;
instance: AbortSignal;
}>;
}

@@ -164,3 +168,3 @@ /**

}
export declare type IncrementalResult<
export type IncrementalResult<
TData = ObjMap<unknown>,

@@ -171,3 +175,3 @@ TExtensions = ObjMap<unknown>,

| IncrementalStreamResult<TData, TExtensions>;
export declare type FormattedIncrementalResult<
export type FormattedIncrementalResult<
TData = ObjMap<unknown>,

@@ -190,2 +194,3 @@ TExtensions = ObjMap<unknown>,

subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
signal?: AbortSignal;
}

@@ -428,3 +433,3 @@ /**

}
declare type AsyncPayloadRecord = DeferredFragmentRecord | StreamRecord;
type AsyncPayloadRecord = DeferredFragmentRecord | StreamRecord;
export {};

@@ -114,3 +114,17 @@ 'use strict';

exports.experimentalExecuteIncrementally = experimentalExecuteIncrementally;
function subscribeToAbortSignal(exeContext) {
const onAbort = () => {
if ('signal' in exeContext && exeContext.signal) {
exeContext.signal.isAborted = true;
}
};
exeContext.signal?.instance.addEventListener('abort', onAbort);
return {
unsubscribeFromAbortSignal: () => {
exeContext.signal?.instance.removeEventListener('abort', onAbort);
},
};
}
function executeImpl(exeContext) {
const { unsubscribeFromAbortSignal } = subscribeToAbortSignal(exeContext);
// Return a Promise that will eventually resolve to the data described by

@@ -132,2 +146,3 @@ // The "Response" section of the GraphQL specification.

(data) => {
unsubscribeFromAbortSignal();
const initialResult = buildResponse(data, exeContext.errors);

@@ -146,2 +161,3 @@ if (exeContext.subsequentPayloads.size > 0) {

(error) => {
unsubscribeFromAbortSignal();
exeContext.errors.push(error);

@@ -152,2 +168,3 @@ return buildResponse(null, exeContext.errors);

}
unsubscribeFromAbortSignal();
const initialResult = buildResponse(result, exeContext.errors);

@@ -165,2 +182,3 @@ if (exeContext.subsequentPayloads.size > 0) {

} catch (error) {
unsubscribeFromAbortSignal();
exeContext.errors.push(error);

@@ -211,2 +229,3 @@ return buildResponse(null, exeContext.errors);

subscribeFieldResolver,
signal,
} = args;

@@ -275,2 +294,3 @@ // If the schema used for execution is invalid, throw an error.

errors: [],
signal: signal ? { instance: signal, isAborted: false } : null,
};

@@ -283,2 +303,3 @@ }

rootValue: payload,
subsequentPayloads: new Set(),
errors: [],

@@ -395,22 +416,34 @@ };

let containsPromise = false;
for (const [responseName, fieldNodes] of fields) {
const fieldPath = (0, Path_js_1.addPath)(
path,
responseName,
parentType.name,
);
const result = executeField(
exeContext,
parentType,
sourceValue,
fieldNodes,
fieldPath,
asyncPayloadRecord,
);
if (result !== undefined) {
results[responseName] = result;
if ((0, isPromise_js_1.isPromise)(result)) {
containsPromise = true;
try {
for (const [responseName, fieldNodes] of fields) {
const fieldPath = (0, Path_js_1.addPath)(
path,
responseName,
parentType.name,
);
const result = executeField(
exeContext,
parentType,
sourceValue,
fieldNodes,
fieldPath,
asyncPayloadRecord,
);
if (result !== undefined) {
results[responseName] = result;
if ((0, isPromise_js_1.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_js_1.promiseForObject)(results).finally(
() => {
throw error;
},
);
}
throw error;
}

@@ -504,3 +537,3 @@ // If there are no promises, we can just return the object

const handledError = handleFieldError(error, returnType, errors);
filterSubsequentPayloads(exeContext, path);
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
return handledError;

@@ -517,3 +550,3 @@ });

const handledError = handleFieldError(error, returnType, errors);
filterSubsequentPayloads(exeContext, path);
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
return handledError;

@@ -584,2 +617,9 @@ }

) {
if (exeContext.signal?.isAborted) {
throw new GraphQLError_js_1.GraphQLError(
`Execution aborted. Reason: ${
exeContext.signal.instance.reason ?? 'Unknown.'
}`,
);
}
// If result is an Error, throw a located error.

@@ -734,43 +774,34 @@ if (result instanceof Error) {

}
const fieldPath = (0, Path_js_1.addPath)(path, index, undefined);
const itemPath = (0, Path_js_1.addPath)(path, index, undefined);
let iteration;
try {
// eslint-disable-next-line no-await-in-loop
const { value, done } = await iterator.next();
if (done) {
iteration = await iterator.next();
if (iteration.done) {
break;
}
try {
// TODO can the error checking logic be consolidated with completeListValue?
const completedItem = completeValue(
exeContext,
itemType,
fieldNodes,
info,
fieldPath,
value,
asyncPayloadRecord,
);
if ((0, isPromise_js_1.isPromise)(completedItem)) {
containsPromise = true;
}
completedResults.push(completedItem);
} catch (rawError) {
completedResults.push(null);
const error = (0, locatedError_js_1.locatedError)(
rawError,
fieldNodes,
(0, Path_js_1.pathToArray)(fieldPath),
);
handleFieldError(error, itemType, errors);
}
} catch (rawError) {
completedResults.push(null);
const error = (0, locatedError_js_1.locatedError)(
rawError,
fieldNodes,
(0, Path_js_1.pathToArray)(fieldPath),
(0, Path_js_1.pathToArray)(itemPath),
);
handleFieldError(error, itemType, errors);
completedResults.push(handleFieldError(error, itemType, errors));
break;
}
if (
completeListItemValue(
iteration.value,
completedResults,
errors,
exeContext,
itemType,
fieldNodes,
info,
itemPath,
asyncPayloadRecord,
)
) {
containsPromise = true;
}
index += 1;

@@ -823,78 +854,110 @@ }

const itemPath = (0, Path_js_1.addPath)(path, index, undefined);
try {
let completedItem;
if (
stream &&
typeof stream.initialCount === 'number' &&
index >= stream.initialCount
) {
previousAsyncPayloadRecord = executeStreamField(
path,
itemPath,
item,
if (
stream &&
typeof stream.initialCount === 'number' &&
index >= stream.initialCount
) {
previousAsyncPayloadRecord = executeStreamField(
path,
itemPath,
item,
exeContext,
fieldNodes,
info,
itemType,
stream.label,
previousAsyncPayloadRecord,
);
index++;
continue;
}
if (
completeListItemValue(
item,
completedResults,
errors,
exeContext,
itemType,
fieldNodes,
info,
itemPath,
asyncPayloadRecord,
)
) {
containsPromise = true;
}
index++;
}
return containsPromise ? Promise.all(completedResults) : completedResults;
}
/**
* Complete a list item value by adding it to the completed results.
*
* Returns true if the value is a Promise.
*/
function completeListItemValue(
item,
completedResults,
errors,
exeContext,
itemType,
fieldNodes,
info,
itemPath,
asyncPayloadRecord,
) {
try {
let completedItem;
if ((0, isPromise_js_1.isPromise)(item)) {
completedItem = item.then((resolved) =>
completeValue(
exeContext,
fieldNodes,
info,
itemType,
stream.label,
previousAsyncPayloadRecord,
);
index++;
continue;
}
if ((0, isPromise_js_1.isPromise)(item)) {
completedItem = item.then((resolved) =>
completeValue(
exeContext,
itemType,
fieldNodes,
info,
itemPath,
resolved,
asyncPayloadRecord,
),
);
} else {
completedItem = completeValue(
exeContext,
itemType,
fieldNodes,
info,
itemPath,
item,
resolved,
asyncPayloadRecord,
);
}
if ((0, isPromise_js_1.isPromise)(completedItem)) {
containsPromise = true;
// Note: we don't rely on a `catch` method, but we do expect "thenable"
// to take a second callback for the error case.
completedResults.push(
completedItem.then(undefined, (rawError) => {
const error = (0, locatedError_js_1.locatedError)(
rawError,
fieldNodes,
(0, Path_js_1.pathToArray)(itemPath),
);
const handledError = handleFieldError(error, itemType, errors);
filterSubsequentPayloads(exeContext, itemPath);
return handledError;
}),
);
} else {
completedResults.push(completedItem);
}
} catch (rawError) {
const error = (0, locatedError_js_1.locatedError)(
rawError,
),
);
} else {
completedItem = completeValue(
exeContext,
itemType,
fieldNodes,
(0, Path_js_1.pathToArray)(itemPath),
info,
itemPath,
item,
asyncPayloadRecord,
);
const handledError = handleFieldError(error, itemType, errors);
filterSubsequentPayloads(exeContext, itemPath);
completedResults.push(handledError);
}
index++;
if ((0, isPromise_js_1.isPromise)(completedItem)) {
// Note: we don't rely on a `catch` method, but we do expect "thenable"
// to take a second callback for the error case.
completedResults.push(
completedItem.then(undefined, (rawError) => {
const error = (0, locatedError_js_1.locatedError)(
rawError,
fieldNodes,
(0, Path_js_1.pathToArray)(itemPath),
);
const handledError = handleFieldError(error, itemType, errors);
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
return handledError;
}),
);
return true;
}
completedResults.push(completedItem);
} catch (rawError) {
const error = (0, locatedError_js_1.locatedError)(
rawError,
fieldNodes,
(0, Path_js_1.pathToArray)(itemPath),
);
const handledError = handleFieldError(error, itemType, errors);
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
completedResults.push(handledError);
}
return containsPromise ? Promise.all(completedResults) : completedResults;
return false;
}

@@ -1582,3 +1645,3 @@ /**

asyncPayloadRecord,
fieldPath,
itemPath,
) {

@@ -1597,6 +1660,5 @@ let item;

fieldNodes,
(0, Path_js_1.pathToArray)(fieldPath),
(0, Path_js_1.pathToArray)(itemPath),
);
const value = handleFieldError(error, itemType, asyncPayloadRecord.errors);
filterSubsequentPayloads(exeContext, fieldPath, asyncPayloadRecord);
// don't continue if iterator throws

@@ -1612,3 +1674,3 @@ return { done: true, value };

info,
fieldPath,
itemPath,
item,

@@ -1622,3 +1684,3 @@ asyncPayloadRecord,

fieldNodes,
(0, Path_js_1.pathToArray)(fieldPath),
(0, Path_js_1.pathToArray)(itemPath),
);

@@ -1630,3 +1692,3 @@ const handledError = handleFieldError(

);
filterSubsequentPayloads(exeContext, fieldPath, asyncPayloadRecord);
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
return handledError;

@@ -1640,6 +1702,6 @@ });

fieldNodes,
(0, Path_js_1.pathToArray)(fieldPath),
(0, Path_js_1.pathToArray)(itemPath),
);
const value = handleFieldError(error, itemType, asyncPayloadRecord.errors);
filterSubsequentPayloads(exeContext, fieldPath, asyncPayloadRecord);
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
return { done: false, value };

@@ -1663,6 +1725,6 @@ }

while (true) {
const fieldPath = (0, Path_js_1.addPath)(path, index, undefined);
const itemPath = (0, Path_js_1.addPath)(path, index, undefined);
const asyncPayloadRecord = new StreamRecord({
label,
path: fieldPath,
path: itemPath,
parentContext: previousAsyncPayloadRecord,

@@ -1672,31 +1734,19 @@ iterator,

});
const dataPromise = executeStreamIteratorItem(
iterator,
exeContext,
fieldNodes,
info,
itemType,
asyncPayloadRecord,
fieldPath,
);
asyncPayloadRecord.addItems(
dataPromise
.then(({ value }) => value)
.then(
(value) => [value],
(err) => {
asyncPayloadRecord.errors.push(err);
return null;
},
),
);
let iteration;
try {
// eslint-disable-next-line no-await-in-loop
const { done } = await dataPromise;
if (done) {
break;
}
} catch (err) {
iteration = await executeStreamIteratorItem(
iterator,
exeContext,
fieldNodes,
info,
itemType,
asyncPayloadRecord,
itemPath,
);
} catch (error) {
asyncPayloadRecord.errors.push(error);
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
asyncPayloadRecord.addItems(null);
// entire stream has errored and bubbled upwards
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
if (iterator?.return) {

@@ -1709,2 +1759,20 @@ iterator.return().catch(() => {

}
const { done, value: completedItem } = iteration;
let completedItems;
if ((0, isPromise_js_1.isPromise)(completedItem)) {
completedItems = completedItem.then(
(value) => [value],
(error) => {
asyncPayloadRecord.errors.push(error);
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
return null;
},
);
} else {
completedItems = [completedItem];
}
asyncPayloadRecord.addItems(completedItems);
if (done) {
break;
}
previousAsyncPayloadRecord = asyncPayloadRecord;

@@ -1711,0 +1779,0 @@ index++;

@@ -1,2 +0,2 @@

declare type AsyncIterableOrGenerator<T> =
type AsyncIterableOrGenerator<T> =
| AsyncGenerator<T, void, void>

@@ -3,0 +3,0 @@ | AsyncIterable<T>;

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

import type { GraphQLSchema } from '../type/schema.js';
declare type CoercedVariableValues =
type CoercedVariableValues =
| {

@@ -15,0 +15,0 @@ errors: ReadonlyArray<GraphQLError>;

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

Symbol.toStringTag in value
? // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009
value[Symbol.toStringTag]
? value[Symbol.toStringTag]
: value.constructor?.name;

@@ -32,0 +31,0 @@ if (className === valueClassName) {

/** Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/ */
export declare type Maybe<T> = null | undefined | T;
export type Maybe<T> = null | undefined | T;
export interface ObjMap<T> {
[key: string]: T;
}
export declare type ObjMapLike<T> =
export type ObjMapLike<T> =
| ObjMap<T>

@@ -12,3 +12,3 @@ | {

}
export declare type ReadOnlyObjMapLike<T> =
export type ReadOnlyObjMapLike<T> =
| ReadOnlyObjMap<T>

@@ -15,0 +15,0 @@ | {

@@ -1,1 +0,1 @@

export declare type PromiseOrValue<T> = Promise<T> | T;
export type PromiseOrValue<T> = Promise<T> | T;

@@ -94,3 +94,3 @@ import type { Kind } from './kinds.js';

*/
export declare type ASTNode =
export type ASTNode =
| NameNode

@@ -145,3 +145,3 @@ | DocumentNode

*/
export declare type ASTKindToNode = {
export type ASTKindToNode = {
[NodeT in ASTNode as NodeT['kind']]: NodeT;

@@ -171,7 +171,7 @@ };

}
export declare type DefinitionNode =
export type DefinitionNode =
| ExecutableDefinitionNode
| TypeSystemDefinitionNode
| TypeSystemExtensionNode;
export declare type ExecutableDefinitionNode =
export type ExecutableDefinitionNode =
| OperationDefinitionNode

@@ -213,6 +213,3 @@ | FragmentDefinitionNode;

}
export declare type SelectionNode =
| FieldNode
| FragmentSpreadNode
| InlineFragmentNode;
export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode;
export interface FieldNode {

@@ -228,3 +225,3 @@ readonly kind: Kind.FIELD;

}
export declare type NullabilityAssertionNode =
export type NullabilityAssertionNode =
| NonNullAssertionNode

@@ -287,3 +284,3 @@ | ErrorBoundaryNode

/** Values */
export declare type ValueNode =
export type ValueNode =
| VariableNode

@@ -298,3 +295,3 @@ | IntValueNode

| ObjectValueNode;
export declare type ConstValueNode =
export type ConstValueNode =
| IntValueNode

@@ -384,3 +381,3 @@ | FloatValueNode

/** Type Reference */
export declare type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode;
export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode;
export interface NamedTypeNode {

@@ -402,3 +399,3 @@ readonly kind: Kind.NAMED_TYPE;

/** Type System Definition */
export declare type TypeSystemDefinitionNode =
export type TypeSystemDefinitionNode =
| SchemaDefinitionNode

@@ -421,3 +418,3 @@ | TypeDefinitionNode

/** Type Definition */
export declare type TypeDefinitionNode =
export type TypeDefinitionNode =
| ScalarTypeDefinitionNode

@@ -514,5 +511,3 @@ | ObjectTypeDefinitionNode

/** Type System Extensions */
export declare type TypeSystemExtensionNode =
| SchemaExtensionNode
| TypeExtensionNode;
export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode;
export interface SchemaExtensionNode {

@@ -527,3 +522,3 @@ readonly kind: Kind.SCHEMA_EXTENSION;

/** Type Extensions */
export declare type TypeExtensionNode =
export type TypeExtensionNode =
| ScalarTypeExtensionNode

@@ -530,0 +525,0 @@ | ObjectTypeExtensionNode

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

}
firstNonEmptyLine = firstNonEmptyLine ?? i;
firstNonEmptyLine ?? (firstNonEmptyLine = i);
lastNonEmptyLine = i;

@@ -29,0 +29,0 @@ if (i !== 0 && indent < commonIndent) {

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

token.start,
`Document contains more that ${maxTokens} tokens. Parsing aborted.`,
`Document contains more than ${maxTokens} tokens. Parsing aborted.`,
);

@@ -1359,0 +1359,0 @@ }

@@ -7,4 +7,4 @@ import type { ASTNode } from './ast.js';

*/
export declare type ASTVisitor = EnterLeaveVisitor<ASTNode> | KindVisitor;
declare type KindVisitor = {
export type ASTVisitor = EnterLeaveVisitor<ASTNode> | KindVisitor;
type KindVisitor = {
readonly [NodeT in ASTNode as NodeT['kind']]?:

@@ -22,3 +22,3 @@ | ASTVisitFn<NodeT>

*/
export declare type ASTVisitFn<TVisitedNode extends ASTNode> = (
export type ASTVisitFn<TVisitedNode extends ASTNode> = (
/** The current node being visiting. */

@@ -43,3 +43,3 @@ node: TVisitedNode,

*/
export declare type ASTReducer<R> = {
export type ASTReducer<R> = {
readonly [NodeT in ASTNode as NodeT['kind']]?: {

@@ -50,3 +50,3 @@ readonly enter?: ASTVisitFn<NodeT>;

};
declare type ASTReducerFn<TReducedNode extends ASTNode, R> = (
type ASTReducerFn<TReducedNode extends ASTNode, R> = (
/** The current node being visiting. */

@@ -69,3 +69,3 @@ node: {

) => R;
declare type ReducedField<T, R> = T extends null | undefined
type ReducedField<T, R> = T extends null | undefined
? T

@@ -78,3 +78,3 @@ : T extends ReadonlyArray<any>

*/
export declare type ASTVisitorKeyMap = {
export type ASTVisitorKeyMap = {
[NodeT in ASTNode as NodeT['kind']]?: ReadonlyArray<keyof NodeT>;

@@ -81,0 +81,0 @@ };

{
"name": "graphql",
"version": "17.0.0-alpha.2",
"version": "17.0.0-alpha.2.canary.pr.3791.264f22163eb937ff87a420be9f7d45965f2cbf07",
"description": "A Query Language and Runtime which can target any service.",

@@ -35,6 +35,7 @@ "license": "MIT",

"publishConfig": {
"tag": "alpha"
"tag": "canary-pr-3791"
},
"main": "index",
"module": "index.mjs"
}
"module": "index.mjs",
"deprecated": "You are using canary version build from https://github.com/graphql/graphql-js/pull/3791, no gurantees provided so please use your own discretion."
}

@@ -117,12 +117,2 @@ # GraphQL.js

### Experimental features
Each release of GraphQL.js will be accompanied by an experimental release containing support for the `@defer` and `@stream` directive proposal. We are hoping to get community feedback on these releases before the proposal is accepted into the GraphQL specification. You can use this experimental release of GraphQL.js by adding the following to your project's `package.json` file.
```
"graphql": "experimental-stream-defer"
```
Community feedback on this experimental release is much appreciated and can be provided on the [issue created for this purpose](https://github.com/graphql/graphql-js/issues/2848).
### Using in a Browser

@@ -129,0 +119,0 @@

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

*/
export declare type GraphQLType = GraphQLNamedType | GraphQLWrappingType;
export type GraphQLType = GraphQLNamedType | GraphQLWrappingType;
export declare function isType(type: unknown): type is GraphQLType;

@@ -82,6 +82,6 @@ export declare function assertType(type: unknown): GraphQLType;

*/
export declare type GraphQLNullableInputType =
export type GraphQLNullableInputType =
| GraphQLNamedInputType
| GraphQLList<GraphQLInputType>;
export declare type GraphQLInputType =
export type GraphQLInputType =
| GraphQLNullableInputType

@@ -94,6 +94,6 @@ | GraphQLNonNull<GraphQLNullableInputType>;

*/
export declare type GraphQLNullableOutputType =
export type GraphQLNullableOutputType =
| GraphQLNamedOutputType
| GraphQLList<GraphQLOutputType>;
export declare type GraphQLOutputType =
export type GraphQLOutputType =
| GraphQLNullableOutputType

@@ -106,3 +106,3 @@ | GraphQLNonNull<GraphQLNullableOutputType>;

*/
export declare type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;
export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;
export declare function isLeafType(type: unknown): type is GraphQLLeafType;

@@ -113,3 +113,3 @@ export declare function assertLeafType(type: unknown): GraphQLLeafType;

*/
export declare type GraphQLCompositeType =
export type GraphQLCompositeType =
| GraphQLObjectType

@@ -127,5 +127,3 @@ | GraphQLInterfaceType

*/
export declare type GraphQLAbstractType =
| GraphQLInterfaceType
| GraphQLUnionType;
export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType;
export declare function isAbstractType(

@@ -192,3 +190,3 @@ type: unknown,

*/
export declare type GraphQLWrappingType =
export type GraphQLWrappingType =
| GraphQLList<GraphQLType>

@@ -203,5 +201,3 @@ | GraphQLNonNull<GraphQLNullableType>;

*/
export declare type GraphQLNullableType =
| GraphQLNamedType
| GraphQLList<GraphQLType>;
export type GraphQLNullableType = GraphQLNamedType | GraphQLList<GraphQLType>;
export declare function isNullableType(

@@ -221,10 +217,8 @@ type: unknown,

*/
export declare type GraphQLNamedType =
| GraphQLNamedInputType
| GraphQLNamedOutputType;
export declare type GraphQLNamedInputType =
export type GraphQLNamedType = GraphQLNamedInputType | GraphQLNamedOutputType;
export type GraphQLNamedInputType =
| GraphQLScalarType
| GraphQLEnumType
| GraphQLInputObjectType;
export declare type GraphQLNamedOutputType =
export type GraphQLNamedOutputType =
| GraphQLScalarType

@@ -252,6 +246,4 @@ | GraphQLObjectType

*/
export declare type ThunkReadonlyArray<T> =
| (() => ReadonlyArray<T>)
| ReadonlyArray<T>;
export declare type ThunkObjMap<T> = (() => ObjMap<T>) | ObjMap<T>;
export type ThunkReadonlyArray<T> = (() => ReadonlyArray<T>) | ReadonlyArray<T>;
export type ThunkObjMap<T> = (() => ObjMap<T>) | ObjMap<T>;
export declare function resolveReadonlyArrayThunk<T>(

@@ -323,9 +315,9 @@ thunk: ThunkReadonlyArray<T>,

}
export declare type GraphQLScalarSerializer<TExternal> = (
export type GraphQLScalarSerializer<TExternal> = (
outputValue: unknown,
) => TExternal;
export declare type GraphQLScalarValueParser<TInternal> = (
export type GraphQLScalarValueParser<TInternal> = (
inputValue: unknown,
) => TInternal;
export declare type GraphQLScalarLiteralParser<TInternal> = (
export type GraphQLScalarLiteralParser<TInternal> = (
valueNode: ValueNode,

@@ -454,3 +446,3 @@ variables?: Maybe<ObjMap<unknown>>,

}
export declare type GraphQLTypeResolver<TSource, TContext> = (
export type GraphQLTypeResolver<TSource, TContext> = (
value: TSource,

@@ -461,3 +453,3 @@ context: TContext,

) => PromiseOrValue<string | undefined>;
export declare type GraphQLIsTypeOfFn<TSource, TContext> = (
export type GraphQLIsTypeOfFn<TSource, TContext> = (
source: TSource,

@@ -467,3 +459,3 @@ context: TContext,

) => PromiseOrValue<boolean>;
export declare type GraphQLFieldResolver<
export type GraphQLFieldResolver<
TSource,

@@ -520,4 +512,3 @@ TContext,

}
export declare type GraphQLFieldConfigArgumentMap =
ObjMap<GraphQLArgumentConfig>;
export type GraphQLFieldConfigArgumentMap = ObjMap<GraphQLArgumentConfig>;
/**

@@ -543,3 +534,3 @@ * Custom extensions

}
export declare type GraphQLFieldConfigMap<TSource, TContext> = ObjMap<
export type GraphQLFieldConfigMap<TSource, TContext> = ObjMap<
GraphQLFieldConfig<TSource, TContext>

@@ -568,3 +559,3 @@ >;

export declare function isRequiredArgument(arg: GraphQLArgument): boolean;
export declare type GraphQLFieldMap<TSource, TContext> = ObjMap<
export type GraphQLFieldMap<TSource, TContext> = ObjMap<
GraphQLField<TSource, TContext>

@@ -783,3 +774,3 @@ >;

}
export declare type GraphQLEnumValueConfigMap = ObjMap<GraphQLEnumValueConfig>;
export type GraphQLEnumValueConfigMap = ObjMap<GraphQLEnumValueConfig>;
/**

@@ -893,4 +884,3 @@ * Custom extensions

}
export declare type GraphQLInputFieldConfigMap =
ObjMap<GraphQLInputFieldConfig>;
export type GraphQLInputFieldConfigMap = ObjMap<GraphQLInputFieldConfig>;
export interface GraphQLInputField {

@@ -906,3 +896,3 @@ name: string;

export declare function isRequiredInputField(field: GraphQLInputField): boolean;
export declare type GraphQLInputFieldMap = ObjMap<GraphQLInputField>;
export type GraphQLInputFieldMap = ObjMap<GraphQLInputField>;
export {};

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

}
declare type TypeMap = ObjMap<GraphQLNamedType>;
type TypeMap = ObjMap<GraphQLNamedType>;
export interface GraphQLSchemaValidationOptions {

@@ -157,0 +157,0 @@ /**

import { GraphQLError } from '../error/GraphQLError.js';
import type { GraphQLInputType } from '../type/definition.js';
declare type OnErrorCB = (
type OnErrorCB = (
path: ReadonlyArray<string | number>,

@@ -5,0 +5,0 @@ invalidValue: unknown,

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

return {
description: schemaDef?.description?.value,
description: schemaDef?.description?.value ?? schemaConfig.description,
...operationTypes,

@@ -138,3 +138,3 @@ types: Object.values(typeMap),

],
extensions: Object.create(null),
extensions: schemaConfig.extensions,
astNode: schemaDef ?? schemaConfig.astNode,

@@ -141,0 +141,0 @@ extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions),

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

}
export declare type IntrospectionType =
export type IntrospectionType =
| IntrospectionScalarType

@@ -60,3 +60,3 @@ | IntrospectionObjectType

| IntrospectionInputObjectType;
export declare type IntrospectionOutputType =
export type IntrospectionOutputType =
| IntrospectionScalarType

@@ -67,3 +67,3 @@ | IntrospectionObjectType

| IntrospectionEnumType;
export declare type IntrospectionInputType =
export type IntrospectionInputType =
| IntrospectionScalarType

@@ -131,3 +131,3 @@ | IntrospectionEnumType

}
export declare type IntrospectionTypeRef =
export type IntrospectionTypeRef =
| IntrospectionNamedTypeRef

@@ -138,3 +138,3 @@ | IntrospectionListTypeRef

>;
export declare type IntrospectionOutputTypeRef =
export type IntrospectionOutputTypeRef =
| IntrospectionNamedTypeRef<IntrospectionOutputType>

@@ -146,3 +146,3 @@ | IntrospectionListTypeRef<IntrospectionOutputTypeRef>

>;
export declare type IntrospectionInputTypeRef =
export type IntrospectionInputTypeRef =
| IntrospectionNamedTypeRef<IntrospectionInputType>

@@ -149,0 +149,0 @@ | IntrospectionListTypeRef<IntrospectionInputTypeRef>

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

}
declare type GetFieldDefFn = (
type GetFieldDefFn = (
schema: GraphQLSchema,

@@ -57,0 +57,0 @@ parentType: GraphQLCompositeType,

import type { ASTVisitor } from '../../language/visitor.js';
import type { ValidationContext } from '../ValidationContext.js';
/**
* Stream directive on list field
* Defer and stream directive labels are unique
*

@@ -6,0 +6,0 @@ * A GraphQL document is only valid if defer and stream directives' label argument is static and unique.

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

/**
* Stream directive on list field
* Defer and stream directive labels are unique
*

@@ -11,0 +11,0 @@ * A GraphQL document is only valid if defer and stream directives' label argument is static and unique.

import type { ASTVisitor } from '../../language/visitor.js';
import type { ValidationContext } from '../ValidationContext.js';
/**
* Stream directive on list field
* Defer and stream directives are used on valid root field
*

@@ -6,0 +6,0 @@ * A GraphQL document is only valid if defer directives are not used on root mutation or subscription types.

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

/**
* Stream directive on list field
* Defer and stream directives are used on valid root field
*

@@ -10,0 +10,0 @@ * A GraphQL document is only valid if defer directives are not used on root mutation or subscription types.

import type { ASTVisitor } from '../../language/visitor.js';
import type { ValidationContext } from '../ValidationContext.js';
/**
* Stream directive on list field
* Stream directives are used on list fields
*

@@ -6,0 +6,0 @@ * A GraphQL document is only valid if stream directives are used on list fields.

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

/**
* Stream directive on list field
* Stream directives are used on list fields
*

@@ -11,0 +11,0 @@ * A GraphQL document is only valid if stream directives are used on list fields.

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

import { TypeInfo } from '../utilities/TypeInfo.js';
declare type NodeWithSelectionSet =
| OperationDefinitionNode
| FragmentDefinitionNode;
type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode;
interface VariableUsage {

@@ -53,5 +51,3 @@ readonly node: VariableNode;

}
export declare type ASTValidationRule = (
context: ASTValidationContext,
) => ASTVisitor;
export type ASTValidationRule = (context: ASTValidationContext) => ASTVisitor;
export declare class SDLValidationContext extends ASTValidationContext {

@@ -67,5 +63,3 @@ private _schema;

}
export declare type SDLValidationRule = (
context: SDLValidationContext,
) => ASTVisitor;
export type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor;
export declare class ValidationContext extends ASTValidationContext {

@@ -97,3 +91,3 @@ private _schema;

}
export declare type ValidationRule = (context: ValidationContext) => ASTVisitor;
export type ValidationRule = (context: ValidationContext) => ASTVisitor;
export {};

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