added graphql entegration and tested tanstack query
This commit is contained in:
23
node_modules/.package-lock.json
generated
vendored
Normal file
23
node_modules/.package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "evyos-frontend-development",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@types/graphql": {
|
||||
"version": "14.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/graphql/-/graphql-14.2.3.tgz",
|
||||
"integrity": "sha512-UoCovaxbJIxagCvVfalfK7YaNhmxj3BQFRQ2RHQKLiu+9wNXhJnlbspsLHt/YQM99IaLUUFJNzCwzc6W0ypMeQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/graphql": {
|
||||
"version": "16.12.0",
|
||||
"resolved": "https://registry.npmjs.org/graphql/-/graphql-16.12.0.tgz",
|
||||
"integrity": "sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
node_modules/@types/graphql/LICENSE
generated
vendored
Normal file
21
node_modules/@types/graphql/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
16
node_modules/@types/graphql/README.md
generated
vendored
Normal file
16
node_modules/@types/graphql/README.md
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/graphql`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for graphql (https://github.com/graphql/graphql-js).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graphql
|
||||
|
||||
Additional Details
|
||||
* Last updated: Mon, 22 Jul 2019 20:06:37 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by TonyYang <https://github.com/TonyPythoneer>, Caleb Meredith <https://github.com/calebmer>, Dominic Watson <https://github.com/intellix>, Firede <https://github.com/firede>, Kepennar <https://github.com/kepennar>, Mikhail Novikov <https://github.com/freiksenet>, Ivan Goncharov <https://github.com/IvanGoncharov>, Hagai Cohen <https://github.com/DxCx>, Ricardo Portugal <https://github.com/rportugal>, Tim Griesser <https://github.com/tgriesser>, Dylan Stewart <https://github.com/dyst5422>, Alessio Dionisi <https://github.com/adnsio>, Divyendu Singh <https://github.com/divyenduz>, Brad Zacher <https://github.com/bradzacher>, Curtis Layne <https://github.com/clayne11>, Jonathan Cardoso <https://github.com/JCMais>, Pavel Lang <https://github.com/langpavel>, Mark Caudill <https://github.com/mc0>, Martijn Walraven <https://github.com/martijnwalraven>, and Jed Mao <https://github.com/jedmao>.
|
||||
78
node_modules/@types/graphql/error/GraphQLError.d.ts
generated
vendored
Normal file
78
node_modules/@types/graphql/error/GraphQLError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { getLocation } from "../language";
|
||||
import { ASTNode } from "../language/ast";
|
||||
import { Source } from "../language/source";
|
||||
import { SourceLocation } from "../language/location";
|
||||
|
||||
/**
|
||||
* A GraphQLError describes an Error found during the parse, validate, or
|
||||
* execute phases of performing a GraphQL operation. In addition to a message
|
||||
* and stack trace, it also includes information about the locations in a
|
||||
* GraphQL document and/or execution result that correspond to the Error.
|
||||
*/
|
||||
export class GraphQLError extends Error {
|
||||
/**
|
||||
* A message describing the Error for debugging purposes.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*
|
||||
* Note: should be treated as readonly, despite invariant usage.
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* An array of { line, column } locations within the source GraphQL document
|
||||
* which correspond to this error.
|
||||
*
|
||||
* Errors during validation often contain multiple locations, for example to
|
||||
* point out two things with the same name. Errors during execution include a
|
||||
* single location, the field which produced the error.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*/
|
||||
readonly locations: ReadonlyArray<SourceLocation> | undefined;
|
||||
|
||||
/**
|
||||
* An array describing the JSON-path into the execution response which
|
||||
* corresponds to this error. Only included for errors during execution.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*/
|
||||
readonly path: ReadonlyArray<string | number> | undefined;
|
||||
|
||||
/**
|
||||
* An array of GraphQL AST Nodes corresponding to this error.
|
||||
*/
|
||||
readonly nodes: ReadonlyArray<ASTNode> | undefined;
|
||||
|
||||
/**
|
||||
* The source GraphQL document corresponding to this error.
|
||||
*/
|
||||
readonly source: Source | undefined;
|
||||
|
||||
/**
|
||||
* An array of character offsets within the source GraphQL document
|
||||
* which correspond to this error.
|
||||
*/
|
||||
readonly positions: ReadonlyArray<number> | undefined;
|
||||
|
||||
/**
|
||||
* The original error thrown from a field resolver during execution.
|
||||
*/
|
||||
readonly originalError: Maybe<Error>;
|
||||
|
||||
/**
|
||||
* Extension fields to add to the formatted error.
|
||||
*/
|
||||
readonly extensions: { [key: string]: any } | undefined;
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
nodes?: ReadonlyArray<ASTNode> | ASTNode | undefined,
|
||||
source?: Maybe<Source>,
|
||||
positions?: Maybe<ReadonlyArray<number>>,
|
||||
path?: Maybe<ReadonlyArray<string | number>>,
|
||||
originalError?: Maybe<Error>,
|
||||
extensions?: Maybe<{ [key: string]: any }>
|
||||
);
|
||||
}
|
||||
39
node_modules/@types/graphql/error/formatError.d.ts
generated
vendored
Normal file
39
node_modules/@types/graphql/error/formatError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import { GraphQLError } from "./GraphQLError";
|
||||
import { SourceLocation } from "../language/location";
|
||||
|
||||
/**
|
||||
* Given a GraphQLError, format it according to the rules described by the
|
||||
* Response Format, Errors section of the GraphQL Specification.
|
||||
*/
|
||||
export function formatError(error: GraphQLError): GraphQLFormattedError;
|
||||
|
||||
/**
|
||||
* @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors
|
||||
*/
|
||||
export interface GraphQLFormattedError<
|
||||
TExtensions extends Record<string, any> = Record<string, any>
|
||||
> {
|
||||
/**
|
||||
* A short, human-readable summary of the problem that **SHOULD NOT** change
|
||||
* from occurrence to occurrence of the problem, except for purposes of
|
||||
* localization.
|
||||
*/
|
||||
readonly message: string
|
||||
/**
|
||||
* If an error can be associated to a particular point in the requested
|
||||
* GraphQL document, it should contain a list of locations.
|
||||
*/
|
||||
readonly locations?: ReadonlyArray<SourceLocation>
|
||||
/**
|
||||
* If an error can be associated to a particular field in the GraphQL result,
|
||||
* it _must_ contain an entry with the key `path` that details the path of
|
||||
* the response field which experienced the error. This allows clients to
|
||||
* identify whether a null result is intentional or caused by a runtime error.
|
||||
*/
|
||||
readonly path?: ReadonlyArray<string | number>
|
||||
/**
|
||||
* Reserved for implementors to extend the protocol however they see fit,
|
||||
* and hence there are no additional restrictions on its contents.
|
||||
*/
|
||||
readonly extensions?: TExtensions
|
||||
}
|
||||
5
node_modules/@types/graphql/error/index.d.ts
generated
vendored
Normal file
5
node_modules/@types/graphql/error/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { GraphQLError } from "./GraphQLError";
|
||||
export { syntaxError } from "./syntaxError";
|
||||
export { locatedError } from "./locatedError";
|
||||
export { printError } from "./printError";
|
||||
export { formatError, GraphQLFormattedError } from "./formatError";
|
||||
13
node_modules/@types/graphql/error/locatedError.d.ts
generated
vendored
Normal file
13
node_modules/@types/graphql/error/locatedError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { GraphQLError } from "./GraphQLError";
|
||||
import { ASTNode } from "../language/ast";
|
||||
|
||||
/**
|
||||
* Given an arbitrary Error, presumably thrown while attempting to execute a
|
||||
* GraphQL operation, produce a new GraphQLError aware of the location in the
|
||||
* document responsible for the original Error.
|
||||
*/
|
||||
export function locatedError(
|
||||
originalError: Error | GraphQLError,
|
||||
nodes: ReadonlyArray<ASTNode>,
|
||||
path: ReadonlyArray<string | number>
|
||||
): GraphQLError;
|
||||
7
node_modules/@types/graphql/error/printError.d.ts
generated
vendored
Normal file
7
node_modules/@types/graphql/error/printError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { GraphQLError } from "./GraphQLError";
|
||||
|
||||
/**
|
||||
* Prints a GraphQLError to a string, representing useful location information
|
||||
* about the error's position in the source.
|
||||
*/
|
||||
export function printError(error: GraphQLError): string;
|
||||
8
node_modules/@types/graphql/error/syntaxError.d.ts
generated
vendored
Normal file
8
node_modules/@types/graphql/error/syntaxError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Source } from "../language/source";
|
||||
import { GraphQLError } from "./GraphQLError";
|
||||
|
||||
/**
|
||||
* Produces a GraphQLError representing a syntax error, containing useful
|
||||
* descriptive information about the syntax error's position in the source.
|
||||
*/
|
||||
export function syntaxError(source: Source, position: number, description: string): GraphQLError;
|
||||
187
node_modules/@types/graphql/execution/execute.d.ts
generated
vendored
Normal file
187
node_modules/@types/graphql/execution/execute.d.ts
generated
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLError, locatedError } from "../error";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import {
|
||||
GraphQLField,
|
||||
GraphQLFieldResolver,
|
||||
ResponsePath,
|
||||
GraphQLObjectType,
|
||||
GraphQLResolveInfo,
|
||||
} from "../type/definition";
|
||||
import {
|
||||
DirectiveNode,
|
||||
DocumentNode,
|
||||
OperationDefinitionNode,
|
||||
SelectionSetNode,
|
||||
FieldNode,
|
||||
InlineFragmentNode,
|
||||
FragmentDefinitionNode,
|
||||
} from "../language/ast";
|
||||
import { PromiseOrValue } from "../jsutils/PromiseOrValue";
|
||||
|
||||
/**
|
||||
* Data that must be available at all points during query execution.
|
||||
*
|
||||
* Namely, schema of the type system that is currently executing,
|
||||
* and the fragments defined in the query document
|
||||
*/
|
||||
export interface ExecutionContext {
|
||||
schema: GraphQLSchema;
|
||||
fragments: { [key: string]: FragmentDefinitionNode };
|
||||
rootValue: any;
|
||||
contextValue: any;
|
||||
operation: OperationDefinitionNode;
|
||||
variableValues: { [key: string]: any };
|
||||
fieldResolver: GraphQLFieldResolver<any, any>;
|
||||
errors: GraphQLError[];
|
||||
}
|
||||
|
||||
export interface ExecutionResultDataDefault {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of GraphQL execution.
|
||||
*
|
||||
* - `errors` is included when any errors occurred as a non-empty array.
|
||||
* - `data` is the result of a successful execution of the query.
|
||||
*/
|
||||
export interface ExecutionResult<TData = ExecutionResultDataDefault> {
|
||||
errors?: ReadonlyArray<GraphQLError>;
|
||||
data?: TData;
|
||||
}
|
||||
|
||||
export type ExecutionArgs = {
|
||||
schema: GraphQLSchema;
|
||||
document: DocumentNode;
|
||||
rootValue?: any;
|
||||
contextValue?: any;
|
||||
variableValues?: Maybe<{ [key: string]: any }>;
|
||||
operationName?: Maybe<string>;
|
||||
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implements the "Evaluating requests" section of the GraphQL specification.
|
||||
*
|
||||
* Returns either a synchronous ExecutionResult (if all encountered resolvers
|
||||
* are synchronous), or a Promise of an ExecutionResult that will eventually be
|
||||
* resolved and never rejected.
|
||||
*
|
||||
* If the arguments to this function do not result in a legal execution context,
|
||||
* a GraphQLError will be thrown immediately explaining the invalid input.
|
||||
*
|
||||
* Accepts either an object with named arguments, or individual arguments.
|
||||
*/
|
||||
export function execute<TData = ExecutionResultDataDefault>(
|
||||
args: ExecutionArgs
|
||||
): PromiseOrValue<ExecutionResult<TData>>;
|
||||
export function execute<TData = ExecutionResultDataDefault>(
|
||||
schema: GraphQLSchema,
|
||||
document: DocumentNode,
|
||||
rootValue?: any,
|
||||
contextValue?: any,
|
||||
variableValues?: Maybe<{ [key: string]: any }>,
|
||||
operationName?: Maybe<string>,
|
||||
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>
|
||||
): PromiseOrValue<ExecutionResult<TData>>;
|
||||
|
||||
/**
|
||||
* Given a ResponsePath (found in the `path` entry in the information provided
|
||||
* as the last argument to a field resolver), return an Array of the path keys.
|
||||
*/
|
||||
export function responsePathAsArray(path: ResponsePath): ReadonlyArray<string | number>;
|
||||
|
||||
/**
|
||||
* Given a ResponsePath and a key, return a new ResponsePath containing the
|
||||
* new key.
|
||||
|
||||
*/
|
||||
export function addPath(
|
||||
prev: ResponsePath | undefined,
|
||||
key: string | number
|
||||
): { prev: ResponsePath | undefined; key: string | number };
|
||||
|
||||
/**
|
||||
* Essential assertions before executing to provide developer feedback for
|
||||
* improper use of the GraphQL library.
|
||||
*/
|
||||
export function assertValidExecutionArguments(
|
||||
schema: GraphQLSchema,
|
||||
document: DocumentNode,
|
||||
rawVariableValues: Maybe<{ [key: string]: any }>
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Constructs a ExecutionContext object from the arguments passed to
|
||||
* execute, which we will pass throughout the other execution methods.
|
||||
*
|
||||
* Throws a GraphQLError if a valid execution context cannot be created.
|
||||
*/
|
||||
export function buildExecutionContext(
|
||||
schema: GraphQLSchema,
|
||||
document: DocumentNode,
|
||||
rootValue: any,
|
||||
contextValue: any,
|
||||
rawVariableValues: Maybe<{ [key: string]: any }>,
|
||||
operationName: Maybe<string>,
|
||||
fieldResolver: Maybe<GraphQLFieldResolver<any, any>>
|
||||
): ReadonlyArray<GraphQLError> | ExecutionContext;
|
||||
|
||||
/**
|
||||
* Given a selectionSet, adds all of the fields in that selection to
|
||||
* the passed in map of fields, and returns it at the end.
|
||||
*
|
||||
* CollectFields requires the "runtime type" of an object. For a field which
|
||||
* returns an Interface or Union type, the "runtime type" will be the actual
|
||||
* Object type returned by that field.
|
||||
*/
|
||||
export function collectFields(
|
||||
exeContext: ExecutionContext,
|
||||
runtimeType: GraphQLObjectType,
|
||||
selectionSet: SelectionSetNode,
|
||||
fields: { [key: string]: Array<FieldNode> },
|
||||
visitedFragmentNames: { [key: string]: boolean }
|
||||
): { [key: string]: Array<FieldNode> };
|
||||
|
||||
export function buildResolveInfo(
|
||||
exeContext: ExecutionContext,
|
||||
fieldDef: GraphQLField<any, any>,
|
||||
fieldNodes: ReadonlyArray<FieldNode>,
|
||||
parentType: GraphQLObjectType,
|
||||
path: ResponsePath
|
||||
): GraphQLResolveInfo;
|
||||
|
||||
// Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField`
|
||||
// function. Returns the result of resolveFn or the abrupt-return Error object.
|
||||
export function resolveFieldValueOrError<TSource>(
|
||||
exeContext: ExecutionContext,
|
||||
fieldDef: GraphQLField<TSource, any>,
|
||||
fieldNodes: ReadonlyArray<FieldNode>,
|
||||
resolveFn: GraphQLFieldResolver<TSource, any>,
|
||||
source: TSource,
|
||||
info: GraphQLResolveInfo
|
||||
): Error | any;
|
||||
|
||||
/**
|
||||
* If a resolve function is not given, then a default resolve behavior is used
|
||||
* which takes the property of the source object of the same name as the field
|
||||
* and returns it as the result, or if it's a function, returns the result
|
||||
* of calling that function while passing along args and context.
|
||||
*/
|
||||
export const defaultFieldResolver: GraphQLFieldResolver<any, any>;
|
||||
|
||||
/**
|
||||
* This method looks up the field on the given type defintion.
|
||||
* It has special casing for the two introspection fields, __schema
|
||||
* and __typename. __typename is special because it can always be
|
||||
* queried as a field, even in situations where no other fields
|
||||
* are allowed, like on a Union. __schema could get automatically
|
||||
* added to the query type, but that would require mutating type
|
||||
* definitions, which would cause issues.
|
||||
*/
|
||||
export function getFieldDef(
|
||||
schema: GraphQLSchema,
|
||||
parentType: GraphQLObjectType,
|
||||
fieldName: string
|
||||
): Maybe<GraphQLField<any, any>>;
|
||||
3
node_modules/@types/graphql/execution/index.d.ts
generated
vendored
Normal file
3
node_modules/@types/graphql/execution/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { execute, defaultFieldResolver, responsePathAsArray, ExecutionArgs, ExecutionResult } from "./execute";
|
||||
|
||||
export { getDirectiveValues } from "./values";
|
||||
59
node_modules/@types/graphql/execution/values.d.ts
generated
vendored
Normal file
59
node_modules/@types/graphql/execution/values.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLError } from "../error/GraphQLError";
|
||||
import { GraphQLInputType, GraphQLField, GraphQLArgument } from "../type/definition";
|
||||
import { GraphQLDirective } from "../type/directives";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { FieldNode, DirectiveNode, VariableDefinitionNode } from "../language/ast";
|
||||
|
||||
interface CoercedVariableValues {
|
||||
errors: ReadonlyArray<GraphQLError> | undefined;
|
||||
coerced: { [key: string]: any } | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares an object map of variableValues of the correct type based on the
|
||||
* provided variable definitions and arbitrary input. If the input cannot be
|
||||
* parsed to match the variable definitions, a GraphQLError will be thrown.
|
||||
*
|
||||
* Note: The returned value is a plain Object with a prototype, since it is
|
||||
* exposed to user code. Care should be taken to not pull values from the
|
||||
* Object prototype.
|
||||
*/
|
||||
export function getVariableValues(
|
||||
schema: GraphQLSchema,
|
||||
varDefNodes: VariableDefinitionNode[],
|
||||
inputs: { [key: string]: any }
|
||||
): CoercedVariableValues;
|
||||
|
||||
/**
|
||||
* Prepares an object map of argument values given a list of argument
|
||||
* definitions and list of argument AST nodes.
|
||||
*
|
||||
* Note: The returned value is a plain Object with a prototype, since it is
|
||||
* exposed to user code. Care should be taken to not pull values from the
|
||||
* Object prototype.
|
||||
*/
|
||||
export function getArgumentValues(
|
||||
def: GraphQLField<any, any> | GraphQLDirective,
|
||||
node: FieldNode | DirectiveNode,
|
||||
variableValues?: Maybe<{ [key: string]: any }>
|
||||
): { [key: string]: any };
|
||||
|
||||
/**
|
||||
* Prepares an object map of argument values given a directive definition
|
||||
* and a AST node which may contain directives. Optionally also accepts a map
|
||||
* of variable values.
|
||||
*
|
||||
* If the directive does not exist on the node, returns undefined.
|
||||
*
|
||||
* Note: The returned value is a plain Object with a prototype, since it is
|
||||
* exposed to user code. Care should be taken to not pull values from the
|
||||
* Object prototype.
|
||||
*/
|
||||
export function getDirectiveValues(
|
||||
directiveDef: GraphQLDirective,
|
||||
node: {
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
},
|
||||
variableValues?: Maybe<{ [key: string]: any }>
|
||||
): undefined | { [key: string]: any };
|
||||
78
node_modules/@types/graphql/graphql.d.ts
generated
vendored
Normal file
78
node_modules/@types/graphql/graphql.d.ts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import Maybe from "./tsutils/Maybe";
|
||||
import { Source } from "./language/source";
|
||||
import { GraphQLFieldResolver } from "./type/definition";
|
||||
import { GraphQLSchema } from "./type/schema";
|
||||
import { ExecutionResult, ExecutionResultDataDefault } from "./execution/execute";
|
||||
|
||||
/**
|
||||
* This is the primary entry point function for fulfilling GraphQL operations
|
||||
* by parsing, validating, and executing a GraphQL document along side a
|
||||
* GraphQL schema.
|
||||
*
|
||||
* More sophisticated GraphQL servers, such as those which persist queries,
|
||||
* may wish to separate the validation and execution phases to a static time
|
||||
* tooling step, and a server runtime step.
|
||||
*
|
||||
* Accepts either an object with named arguments, or individual arguments:
|
||||
*
|
||||
* schema:
|
||||
* The GraphQL type system to use when validating and executing a query.
|
||||
* source:
|
||||
* A GraphQL language formatted string representing the requested operation.
|
||||
* rootValue:
|
||||
* The value provided as the first argument to resolver functions on the top
|
||||
* level type (e.g. the query object type).
|
||||
* contextValue:
|
||||
* The context value is provided as an argument to resolver functions after
|
||||
* field arguments. It is used to pass shared information useful at any point
|
||||
* during executing this query, for example the currently logged in user and
|
||||
* connections to databases or other services.
|
||||
* variableValues:
|
||||
* A mapping of variable name to runtime value to use for all variables
|
||||
* defined in the requestString.
|
||||
* operationName:
|
||||
* The name of the operation to use if requestString contains multiple
|
||||
* possible operations. Can be omitted if requestString contains only
|
||||
* one operation.
|
||||
* fieldResolver:
|
||||
* A resolver function to use when one is not provided by the schema.
|
||||
* If not provided, the default field resolver is used (which looks for a
|
||||
* value or method on the source value with the field's name).
|
||||
*/
|
||||
export interface GraphQLArgs {
|
||||
schema: GraphQLSchema;
|
||||
source: Source | string;
|
||||
rootValue?: any;
|
||||
contextValue?: any;
|
||||
variableValues?: Maybe<{ [key: string]: any }>;
|
||||
operationName?: Maybe<string>;
|
||||
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
|
||||
}
|
||||
|
||||
export function graphql<TData = ExecutionResultDataDefault>(args: GraphQLArgs): Promise<ExecutionResult<TData>>;
|
||||
export function graphql<TData = ExecutionResultDataDefault>(
|
||||
schema: GraphQLSchema,
|
||||
source: Source | string,
|
||||
rootValue?: any,
|
||||
contextValue?: any,
|
||||
variableValues?: Maybe<{ [key: string]: any }>,
|
||||
operationName?: Maybe<string>,
|
||||
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>
|
||||
): Promise<ExecutionResult<TData>>;
|
||||
|
||||
/**
|
||||
* The graphqlSync function also fulfills GraphQL operations by parsing,
|
||||
* validating, and executing a GraphQL document along side a GraphQL schema.
|
||||
* However, it guarantees to complete synchronously (or throw an error) assuming
|
||||
* that all field resolvers are also synchronous.
|
||||
*/
|
||||
export function graphqlSync<TData = ExecutionResultDataDefault>(args: GraphQLArgs): ExecutionResult<TData>;
|
||||
export function graphqlSync<TData = ExecutionResultDataDefault>(
|
||||
schema: GraphQLSchema,
|
||||
source: Source | string,
|
||||
rootValue?: any,
|
||||
contextValue?: any,
|
||||
variableValues?: Maybe<{ [key: string]: any }>,
|
||||
operationName?: Maybe<string>,
|
||||
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>
|
||||
): ExecutionResult<TData>;
|
||||
411
node_modules/@types/graphql/index.d.ts
generated
vendored
Normal file
411
node_modules/@types/graphql/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,411 @@
|
||||
// Type definitions for graphql 14.2
|
||||
// Project: https://github.com/graphql/graphql-js
|
||||
// Definitions by: TonyYang <https://github.com/TonyPythoneer>
|
||||
// Caleb Meredith <https://github.com/calebmer>
|
||||
// Dominic Watson <https://github.com/intellix>
|
||||
// Firede <https://github.com/firede>
|
||||
// Kepennar <https://github.com/kepennar>
|
||||
// Mikhail Novikov <https://github.com/freiksenet>
|
||||
// Ivan Goncharov <https://github.com/IvanGoncharov>
|
||||
// Hagai Cohen <https://github.com/DxCx>
|
||||
// Ricardo Portugal <https://github.com/rportugal>
|
||||
// Tim Griesser <https://github.com/tgriesser>
|
||||
// Dylan Stewart <https://github.com/dyst5422>
|
||||
// Alessio Dionisi <https://github.com/adnsio>
|
||||
// Divyendu Singh <https://github.com/divyenduz>
|
||||
// Brad Zacher <https://github.com/bradzacher>
|
||||
// Curtis Layne <https://github.com/clayne11>
|
||||
// Jonathan Cardoso <https://github.com/JCMais>
|
||||
// Pavel Lang <https://github.com/langpavel>
|
||||
// Mark Caudill <https://github.com/mc0>
|
||||
// Martijn Walraven <https://github.com/martijnwalraven>
|
||||
// Jed Mao <https://github.com/jedmao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
// The primary entry point into fulfilling a GraphQL request.
|
||||
export { graphql, graphqlSync, GraphQLArgs } from "./graphql";
|
||||
|
||||
// Create and operate on GraphQL type definitions and schema.
|
||||
export {
|
||||
GraphQLSchema,
|
||||
// Definitions
|
||||
GraphQLScalarType,
|
||||
GraphQLObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLUnionType,
|
||||
GraphQLEnumType,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLList,
|
||||
GraphQLNonNull,
|
||||
GraphQLDirective,
|
||||
// "Enum" of Type Kinds
|
||||
TypeKind,
|
||||
// Scalars
|
||||
specifiedScalarTypes,
|
||||
GraphQLInt,
|
||||
GraphQLFloat,
|
||||
GraphQLString,
|
||||
GraphQLBoolean,
|
||||
GraphQLID,
|
||||
// Built-in Directives defined by the Spec
|
||||
specifiedDirectives,
|
||||
GraphQLIncludeDirective,
|
||||
GraphQLSkipDirective,
|
||||
GraphQLDeprecatedDirective,
|
||||
// Constant Deprecation Reason
|
||||
DEFAULT_DEPRECATION_REASON,
|
||||
// Meta-field definitions.
|
||||
SchemaMetaFieldDef,
|
||||
TypeMetaFieldDef,
|
||||
TypeNameMetaFieldDef,
|
||||
// GraphQL Types for introspection.
|
||||
introspectionTypes,
|
||||
__Schema,
|
||||
__Directive,
|
||||
__DirectiveLocation,
|
||||
__Type,
|
||||
__Field,
|
||||
__InputValue,
|
||||
__EnumValue,
|
||||
__TypeKind,
|
||||
// Predicates
|
||||
isSchema,
|
||||
isDirective,
|
||||
isType,
|
||||
isScalarType,
|
||||
isObjectType,
|
||||
isInterfaceType,
|
||||
isUnionType,
|
||||
isEnumType,
|
||||
isInputObjectType,
|
||||
isListType,
|
||||
isNonNullType,
|
||||
isInputType,
|
||||
isOutputType,
|
||||
isLeafType,
|
||||
isCompositeType,
|
||||
isAbstractType,
|
||||
isWrappingType,
|
||||
isNullableType,
|
||||
isNamedType,
|
||||
isRequiredArgument,
|
||||
isRequiredInputField,
|
||||
isSpecifiedScalarType,
|
||||
isIntrospectionType,
|
||||
isSpecifiedDirective,
|
||||
// Assertions
|
||||
assertType,
|
||||
assertScalarType,
|
||||
assertObjectType,
|
||||
assertInterfaceType,
|
||||
assertUnionType,
|
||||
assertEnumType,
|
||||
assertInputObjectType,
|
||||
assertListType,
|
||||
assertNonNullType,
|
||||
assertInputType,
|
||||
assertOutputType,
|
||||
assertLeafType,
|
||||
assertCompositeType,
|
||||
assertAbstractType,
|
||||
assertWrappingType,
|
||||
assertNullableType,
|
||||
assertNamedType,
|
||||
// Un-modifiers
|
||||
getNullableType,
|
||||
getNamedType,
|
||||
// Validate GraphQL schema.
|
||||
validateSchema,
|
||||
assertValidSchema,
|
||||
// type
|
||||
GraphQLType,
|
||||
GraphQLInputType,
|
||||
GraphQLOutputType,
|
||||
GraphQLLeafType,
|
||||
GraphQLCompositeType,
|
||||
GraphQLAbstractType,
|
||||
GraphQLWrappingType,
|
||||
GraphQLNullableType,
|
||||
GraphQLNamedType,
|
||||
Thunk,
|
||||
GraphQLSchemaConfig,
|
||||
GraphQLArgument,
|
||||
GraphQLArgumentConfig,
|
||||
GraphQLEnumTypeConfig,
|
||||
GraphQLEnumValue,
|
||||
GraphQLEnumValueConfig,
|
||||
GraphQLEnumValueConfigMap,
|
||||
GraphQLField,
|
||||
GraphQLFieldConfig,
|
||||
GraphQLFieldConfigArgumentMap,
|
||||
GraphQLFieldConfigMap,
|
||||
GraphQLFieldMap,
|
||||
GraphQLFieldResolver,
|
||||
GraphQLInputField,
|
||||
GraphQLInputFieldConfig,
|
||||
GraphQLInputFieldConfigMap,
|
||||
GraphQLInputFieldMap,
|
||||
GraphQLInputObjectTypeConfig,
|
||||
GraphQLInterfaceTypeConfig,
|
||||
GraphQLIsTypeOfFn,
|
||||
GraphQLObjectTypeConfig,
|
||||
GraphQLResolveInfo,
|
||||
ResponsePath,
|
||||
GraphQLScalarTypeConfig,
|
||||
GraphQLTypeResolver,
|
||||
GraphQLUnionTypeConfig,
|
||||
GraphQLDirectiveConfig,
|
||||
GraphQLScalarSerializer,
|
||||
GraphQLScalarValueParser,
|
||||
GraphQLScalarLiteralParser,
|
||||
} from "./type";
|
||||
|
||||
// Parse and operate on GraphQL language source files.
|
||||
export {
|
||||
Source,
|
||||
getLocation,
|
||||
// Parse
|
||||
parse,
|
||||
parseValue,
|
||||
parseType,
|
||||
// Print
|
||||
print,
|
||||
// Visit
|
||||
visit,
|
||||
visitInParallel,
|
||||
visitWithTypeInfo,
|
||||
getVisitFn,
|
||||
Kind,
|
||||
TokenKind,
|
||||
DirectiveLocation,
|
||||
BREAK,
|
||||
// Predicates
|
||||
isDefinitionNode,
|
||||
isExecutableDefinitionNode,
|
||||
isSelectionNode,
|
||||
isValueNode,
|
||||
isTypeNode,
|
||||
isTypeSystemDefinitionNode,
|
||||
isTypeDefinitionNode,
|
||||
isTypeSystemExtensionNode,
|
||||
isTypeExtensionNode,
|
||||
// type
|
||||
Lexer,
|
||||
ParseOptions,
|
||||
SourceLocation,
|
||||
// Visitor utilities
|
||||
ASTVisitor,
|
||||
Visitor,
|
||||
VisitFn,
|
||||
VisitorKeyMap,
|
||||
// AST nodes
|
||||
Location,
|
||||
Token,
|
||||
ASTNode,
|
||||
ASTKindToNode,
|
||||
NameNode,
|
||||
DocumentNode,
|
||||
DefinitionNode,
|
||||
ExecutableDefinitionNode,
|
||||
OperationDefinitionNode,
|
||||
OperationTypeNode,
|
||||
VariableDefinitionNode,
|
||||
VariableNode,
|
||||
SelectionSetNode,
|
||||
SelectionNode,
|
||||
FieldNode,
|
||||
ArgumentNode,
|
||||
FragmentSpreadNode,
|
||||
InlineFragmentNode,
|
||||
FragmentDefinitionNode,
|
||||
ValueNode,
|
||||
IntValueNode,
|
||||
FloatValueNode,
|
||||
StringValueNode,
|
||||
BooleanValueNode,
|
||||
NullValueNode,
|
||||
EnumValueNode,
|
||||
ListValueNode,
|
||||
ObjectValueNode,
|
||||
ObjectFieldNode,
|
||||
DirectiveNode,
|
||||
TypeNode,
|
||||
NamedTypeNode,
|
||||
ListTypeNode,
|
||||
NonNullTypeNode,
|
||||
TypeSystemDefinitionNode,
|
||||
SchemaDefinitionNode,
|
||||
OperationTypeDefinitionNode,
|
||||
TypeDefinitionNode,
|
||||
ScalarTypeDefinitionNode,
|
||||
ObjectTypeDefinitionNode,
|
||||
FieldDefinitionNode,
|
||||
InputValueDefinitionNode,
|
||||
InterfaceTypeDefinitionNode,
|
||||
UnionTypeDefinitionNode,
|
||||
EnumTypeDefinitionNode,
|
||||
EnumValueDefinitionNode,
|
||||
InputObjectTypeDefinitionNode,
|
||||
DirectiveDefinitionNode,
|
||||
TypeSystemExtensionNode,
|
||||
SchemaExtensionNode,
|
||||
TypeExtensionNode,
|
||||
ScalarTypeExtensionNode,
|
||||
ObjectTypeExtensionNode,
|
||||
InterfaceTypeExtensionNode,
|
||||
UnionTypeExtensionNode,
|
||||
EnumTypeExtensionNode,
|
||||
InputObjectTypeExtensionNode,
|
||||
KindEnum,
|
||||
TokenKindEnum,
|
||||
DirectiveLocationEnum,
|
||||
} from "./language";
|
||||
|
||||
// Execute GraphQL queries.
|
||||
export {
|
||||
execute,
|
||||
defaultFieldResolver,
|
||||
responsePathAsArray,
|
||||
getDirectiveValues,
|
||||
// type
|
||||
ExecutionArgs,
|
||||
ExecutionResult,
|
||||
} from "./execution";
|
||||
|
||||
export { subscribe, createSourceEventStream } from "./subscription";
|
||||
|
||||
// Validate GraphQL queries.
|
||||
export {
|
||||
validate,
|
||||
ValidationContext,
|
||||
// All validation rules in the GraphQL Specification.
|
||||
specifiedRules,
|
||||
// Individual validation rules.
|
||||
FieldsOnCorrectTypeRule,
|
||||
FragmentsOnCompositeTypesRule,
|
||||
KnownArgumentNamesRule,
|
||||
KnownDirectivesRule,
|
||||
KnownFragmentNamesRule,
|
||||
KnownTypeNamesRule,
|
||||
LoneAnonymousOperationRule,
|
||||
NoFragmentCyclesRule,
|
||||
NoUndefinedVariablesRule,
|
||||
NoUnusedFragmentsRule,
|
||||
NoUnusedVariablesRule,
|
||||
OverlappingFieldsCanBeMergedRule,
|
||||
PossibleFragmentSpreadsRule,
|
||||
ProvidedRequiredArgumentsRule,
|
||||
ScalarLeafsRule,
|
||||
SingleFieldSubscriptionsRule,
|
||||
UniqueArgumentNamesRule,
|
||||
UniqueDirectivesPerLocationRule,
|
||||
UniqueFragmentNamesRule,
|
||||
UniqueInputFieldNamesRule,
|
||||
UniqueOperationNamesRule,
|
||||
UniqueVariableNamesRule,
|
||||
ValuesOfCorrectTypeRule,
|
||||
VariablesAreInputTypesRule,
|
||||
VariablesInAllowedPositionRule,
|
||||
} from "./validation";
|
||||
|
||||
// Create and format GraphQL errors.
|
||||
export { GraphQLError, formatError, printError, GraphQLFormattedError } from "./error";
|
||||
|
||||
// Utilities for operating on GraphQL type schema and parsed sources.
|
||||
export {
|
||||
// Produce the GraphQL query recommended for a full schema introspection.
|
||||
// Accepts optional IntrospectionOptions.
|
||||
getIntrospectionQuery,
|
||||
// @deprecated: use getIntrospectionQuery - will be removed in v15
|
||||
introspectionQuery,
|
||||
// Gets the target Operation from a Document
|
||||
getOperationAST,
|
||||
// Gets the Type for the target Operation AST.
|
||||
getOperationRootType,
|
||||
// Convert a GraphQLSchema to an IntrospectionQuery
|
||||
introspectionFromSchema,
|
||||
// Build a GraphQLSchema from an introspection result.
|
||||
buildClientSchema,
|
||||
// Build a GraphQLSchema from a parsed GraphQL Schema language AST.
|
||||
buildASTSchema,
|
||||
// Build a GraphQLSchema from a GraphQL schema language document.
|
||||
buildSchema,
|
||||
// @deprecated: Get the description from a schema AST node and supports legacy
|
||||
// syntax for specifying descriptions - will be removed in v16
|
||||
getDescription,
|
||||
// Extends an existing GraphQLSchema from a parsed GraphQL Schema
|
||||
// language AST.
|
||||
extendSchema,
|
||||
// Sort a GraphQLSchema.
|
||||
lexicographicSortSchema,
|
||||
// Print a GraphQLSchema to GraphQL Schema language.
|
||||
printSchema,
|
||||
// Prints the built-in introspection schema in the Schema Language
|
||||
// format.
|
||||
printIntrospectionSchema,
|
||||
// Print a GraphQLType to GraphQL Schema language.
|
||||
printType,
|
||||
// Create a GraphQLType from a GraphQL language AST.
|
||||
typeFromAST,
|
||||
// Create a JavaScript value from a GraphQL language AST with a Type.
|
||||
valueFromAST,
|
||||
// Create a JavaScript value from a GraphQL language AST without a Type.
|
||||
valueFromASTUntyped,
|
||||
// Create a GraphQL language AST from a JavaScript value.
|
||||
astFromValue,
|
||||
// A helper to use within recursive-descent visitors which need to be aware of
|
||||
// the GraphQL type system.
|
||||
TypeInfo,
|
||||
// Coerces a JavaScript value to a GraphQL type, or produces errors.
|
||||
coerceValue,
|
||||
// @deprecated use coerceValue - will be removed in v15
|
||||
isValidJSValue,
|
||||
// @deprecated use validation - will be removed in v15
|
||||
isValidLiteralValue,
|
||||
// Concatenates multiple AST together.
|
||||
concatAST,
|
||||
// Separates an AST into an AST per Operation.
|
||||
separateOperations,
|
||||
// Comparators for types
|
||||
isEqualType,
|
||||
isTypeSubTypeOf,
|
||||
doTypesOverlap,
|
||||
// Asserts a string is a valid GraphQL name.
|
||||
assertValidName,
|
||||
// Determine if a string is a valid GraphQL name.
|
||||
isValidNameError,
|
||||
// Compares two GraphQLSchemas and detects breaking changes.
|
||||
findBreakingChanges,
|
||||
findDangerousChanges,
|
||||
BreakingChangeType,
|
||||
DangerousChangeType,
|
||||
// Report all deprecated usage within a GraphQL document.
|
||||
findDeprecatedUsages,
|
||||
// type
|
||||
BuildSchemaOptions,
|
||||
BreakingChange,
|
||||
DangerousChange,
|
||||
IntrospectionOptions,
|
||||
IntrospectionDirective,
|
||||
IntrospectionEnumType,
|
||||
IntrospectionEnumValue,
|
||||
IntrospectionField,
|
||||
IntrospectionInputObjectType,
|
||||
IntrospectionInputType,
|
||||
IntrospectionInputTypeRef,
|
||||
IntrospectionInputValue,
|
||||
IntrospectionInterfaceType,
|
||||
IntrospectionListTypeRef,
|
||||
IntrospectionNamedTypeRef,
|
||||
IntrospectionNonNullTypeRef,
|
||||
IntrospectionObjectType,
|
||||
IntrospectionOutputType,
|
||||
IntrospectionOutputTypeRef,
|
||||
IntrospectionQuery,
|
||||
IntrospectionScalarType,
|
||||
IntrospectionSchema,
|
||||
IntrospectionType,
|
||||
IntrospectionTypeRef,
|
||||
IntrospectionUnionType,
|
||||
} from "./utilities";
|
||||
1
node_modules/@types/graphql/jsutils/PromiseOrValue.d.ts
generated
vendored
Normal file
1
node_modules/@types/graphql/jsutils/PromiseOrValue.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export type PromiseOrValue<T> = Promise<T> | T;
|
||||
565
node_modules/@types/graphql/language/ast.d.ts
generated
vendored
Normal file
565
node_modules/@types/graphql/language/ast.d.ts
generated
vendored
Normal file
@@ -0,0 +1,565 @@
|
||||
import { Source } from "./source";
|
||||
import { TokenKindEnum } from "./lexer";
|
||||
|
||||
/**
|
||||
* Contains a range of UTF-8 character offsets and token references that
|
||||
* identify the region of the source from which the AST derived.
|
||||
*/
|
||||
export interface Location {
|
||||
/**
|
||||
* The character offset at which this Node begins.
|
||||
*/
|
||||
readonly start: number;
|
||||
|
||||
/**
|
||||
* The character offset at which this Node ends.
|
||||
*/
|
||||
readonly end: number;
|
||||
|
||||
/**
|
||||
* The Token at which this Node begins.
|
||||
*/
|
||||
readonly startToken: Token;
|
||||
|
||||
/**
|
||||
* The Token at which this Node ends.
|
||||
*/
|
||||
readonly endToken: Token;
|
||||
|
||||
/**
|
||||
* The Source document the AST represents.
|
||||
*/
|
||||
readonly source: Source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a range of characters represented by a lexical token
|
||||
* within a Source.
|
||||
*/
|
||||
export interface Token {
|
||||
/**
|
||||
* The kind of Token.
|
||||
*/
|
||||
readonly kind: TokenKindEnum;
|
||||
|
||||
/**
|
||||
* The character offset at which this Node begins.
|
||||
*/
|
||||
readonly start: number;
|
||||
|
||||
/**
|
||||
* The character offset at which this Node ends.
|
||||
*/
|
||||
readonly end: number;
|
||||
|
||||
/**
|
||||
* The 1-indexed line number on which this Token appears.
|
||||
*/
|
||||
readonly line: number;
|
||||
|
||||
/**
|
||||
* The 1-indexed column number at which this Token begins.
|
||||
*/
|
||||
readonly column: number;
|
||||
|
||||
/**
|
||||
* For non-punctuation tokens, represents the interpreted value of the token.
|
||||
*/
|
||||
readonly value: string | undefined;
|
||||
|
||||
/**
|
||||
* Tokens exist as nodes in a double-linked-list amongst all tokens
|
||||
* including ignored tokens. <SOF> is always the first node and <EOF>
|
||||
* the last.
|
||||
*/
|
||||
readonly prev: Token | null;
|
||||
readonly next: Token | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The list of all possible AST node types.
|
||||
*/
|
||||
export type ASTNode =
|
||||
| NameNode
|
||||
| DocumentNode
|
||||
| OperationDefinitionNode
|
||||
| VariableDefinitionNode
|
||||
| VariableNode
|
||||
| SelectionSetNode
|
||||
| FieldNode
|
||||
| ArgumentNode
|
||||
| FragmentSpreadNode
|
||||
| InlineFragmentNode
|
||||
| FragmentDefinitionNode
|
||||
| IntValueNode
|
||||
| FloatValueNode
|
||||
| StringValueNode
|
||||
| BooleanValueNode
|
||||
| NullValueNode
|
||||
| EnumValueNode
|
||||
| ListValueNode
|
||||
| ObjectValueNode
|
||||
| ObjectFieldNode
|
||||
| DirectiveNode
|
||||
| NamedTypeNode
|
||||
| ListTypeNode
|
||||
| NonNullTypeNode
|
||||
| SchemaDefinitionNode
|
||||
| OperationTypeDefinitionNode
|
||||
| ScalarTypeDefinitionNode
|
||||
| ObjectTypeDefinitionNode
|
||||
| FieldDefinitionNode
|
||||
| InputValueDefinitionNode
|
||||
| InterfaceTypeDefinitionNode
|
||||
| UnionTypeDefinitionNode
|
||||
| EnumTypeDefinitionNode
|
||||
| EnumValueDefinitionNode
|
||||
| InputObjectTypeDefinitionNode
|
||||
| DirectiveDefinitionNode
|
||||
| SchemaExtensionNode
|
||||
| ScalarTypeExtensionNode
|
||||
| ObjectTypeExtensionNode
|
||||
| InterfaceTypeExtensionNode
|
||||
| UnionTypeExtensionNode
|
||||
| EnumTypeExtensionNode
|
||||
| InputObjectTypeExtensionNode;
|
||||
|
||||
/**
|
||||
* Utility type listing all nodes indexed by their kind.
|
||||
*/
|
||||
export interface ASTKindToNode {
|
||||
Name: NameNode;
|
||||
Document: DocumentNode;
|
||||
OperationDefinition: OperationDefinitionNode;
|
||||
VariableDefinition: VariableDefinitionNode;
|
||||
Variable: VariableNode;
|
||||
SelectionSet: SelectionSetNode;
|
||||
Field: FieldNode;
|
||||
Argument: ArgumentNode;
|
||||
FragmentSpread: FragmentSpreadNode;
|
||||
InlineFragment: InlineFragmentNode;
|
||||
FragmentDefinition: FragmentDefinitionNode;
|
||||
IntValue: IntValueNode;
|
||||
FloatValue: FloatValueNode;
|
||||
StringValue: StringValueNode;
|
||||
BooleanValue: BooleanValueNode;
|
||||
NullValue: NullValueNode;
|
||||
EnumValue: EnumValueNode;
|
||||
ListValue: ListValueNode;
|
||||
ObjectValue: ObjectValueNode;
|
||||
ObjectField: ObjectFieldNode;
|
||||
Directive: DirectiveNode;
|
||||
NamedType: NamedTypeNode;
|
||||
ListType: ListTypeNode;
|
||||
NonNullType: NonNullTypeNode;
|
||||
SchemaDefinition: SchemaDefinitionNode;
|
||||
OperationTypeDefinition: OperationTypeDefinitionNode;
|
||||
ScalarTypeDefinition: ScalarTypeDefinitionNode;
|
||||
ObjectTypeDefinition: ObjectTypeDefinitionNode;
|
||||
FieldDefinition: FieldDefinitionNode;
|
||||
InputValueDefinition: InputValueDefinitionNode;
|
||||
InterfaceTypeDefinition: InterfaceTypeDefinitionNode;
|
||||
UnionTypeDefinition: UnionTypeDefinitionNode;
|
||||
EnumTypeDefinition: EnumTypeDefinitionNode;
|
||||
EnumValueDefinition: EnumValueDefinitionNode;
|
||||
InputObjectTypeDefinition: InputObjectTypeDefinitionNode;
|
||||
DirectiveDefinition: DirectiveDefinitionNode;
|
||||
SchemaExtension: SchemaExtensionNode;
|
||||
ScalarTypeExtension: ScalarTypeExtensionNode;
|
||||
ObjectTypeExtension: ObjectTypeExtensionNode;
|
||||
InterfaceTypeExtension: InterfaceTypeExtensionNode;
|
||||
UnionTypeExtension: UnionTypeExtensionNode;
|
||||
EnumTypeExtension: EnumTypeExtensionNode;
|
||||
InputObjectTypeExtension: InputObjectTypeExtensionNode;
|
||||
}
|
||||
|
||||
// Name
|
||||
|
||||
export interface NameNode {
|
||||
readonly kind: "Name";
|
||||
readonly loc?: Location;
|
||||
readonly value: string;
|
||||
}
|
||||
|
||||
// Document
|
||||
|
||||
export interface DocumentNode {
|
||||
readonly kind: "Document";
|
||||
readonly loc?: Location;
|
||||
readonly definitions: ReadonlyArray<DefinitionNode>;
|
||||
}
|
||||
|
||||
export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode | TypeSystemExtensionNode;
|
||||
|
||||
export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode;
|
||||
|
||||
export interface OperationDefinitionNode {
|
||||
readonly kind: "OperationDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly operation: OperationTypeNode;
|
||||
readonly name?: NameNode;
|
||||
readonly variableDefinitions?: ReadonlyArray<VariableDefinitionNode>;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly selectionSet: SelectionSetNode;
|
||||
}
|
||||
|
||||
export type OperationTypeNode = "query" | "mutation" | "subscription";
|
||||
|
||||
export interface VariableDefinitionNode {
|
||||
readonly kind: "VariableDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly variable: VariableNode;
|
||||
readonly type: TypeNode;
|
||||
readonly defaultValue?: ValueNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
}
|
||||
|
||||
export interface VariableNode {
|
||||
readonly kind: "Variable";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
}
|
||||
|
||||
export interface SelectionSetNode {
|
||||
kind: "SelectionSet";
|
||||
loc?: Location;
|
||||
selections: ReadonlyArray<SelectionNode>;
|
||||
}
|
||||
|
||||
export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode;
|
||||
|
||||
export interface FieldNode {
|
||||
readonly kind: "Field";
|
||||
readonly loc?: Location;
|
||||
readonly alias?: NameNode;
|
||||
readonly name: NameNode;
|
||||
readonly arguments?: ReadonlyArray<ArgumentNode>;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly selectionSet?: SelectionSetNode;
|
||||
}
|
||||
|
||||
export interface ArgumentNode {
|
||||
readonly kind: "Argument";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly value: ValueNode;
|
||||
}
|
||||
|
||||
// Fragments
|
||||
|
||||
export interface FragmentSpreadNode {
|
||||
readonly kind: "FragmentSpread";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
}
|
||||
|
||||
export interface InlineFragmentNode {
|
||||
readonly kind: "InlineFragment";
|
||||
readonly loc?: Location;
|
||||
readonly typeCondition?: NamedTypeNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly selectionSet: SelectionSetNode;
|
||||
}
|
||||
|
||||
export interface FragmentDefinitionNode {
|
||||
readonly kind: "FragmentDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
// Note: fragment variable definitions are experimental and may be changed
|
||||
// or removed in the future.
|
||||
readonly variableDefinitions?: ReadonlyArray<VariableDefinitionNode>;
|
||||
readonly typeCondition: NamedTypeNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly selectionSet: SelectionSetNode;
|
||||
}
|
||||
|
||||
// Values
|
||||
|
||||
export type ValueNode =
|
||||
| VariableNode
|
||||
| IntValueNode
|
||||
| FloatValueNode
|
||||
| StringValueNode
|
||||
| BooleanValueNode
|
||||
| NullValueNode
|
||||
| EnumValueNode
|
||||
| ListValueNode
|
||||
| ObjectValueNode;
|
||||
|
||||
export interface IntValueNode {
|
||||
readonly kind: "IntValue";
|
||||
readonly loc?: Location;
|
||||
readonly value: string;
|
||||
}
|
||||
|
||||
export interface FloatValueNode {
|
||||
readonly kind: "FloatValue";
|
||||
readonly loc?: Location;
|
||||
readonly value: string;
|
||||
}
|
||||
|
||||
export interface StringValueNode {
|
||||
readonly kind: "StringValue";
|
||||
readonly loc?: Location;
|
||||
readonly value: string;
|
||||
readonly block?: boolean;
|
||||
}
|
||||
|
||||
export interface BooleanValueNode {
|
||||
readonly kind: "BooleanValue";
|
||||
readonly loc?: Location;
|
||||
readonly value: boolean;
|
||||
}
|
||||
|
||||
export interface NullValueNode {
|
||||
readonly kind: "NullValue";
|
||||
readonly loc?: Location;
|
||||
}
|
||||
|
||||
export interface EnumValueNode {
|
||||
readonly kind: "EnumValue";
|
||||
readonly loc?: Location;
|
||||
readonly value: string;
|
||||
}
|
||||
|
||||
export interface ListValueNode {
|
||||
readonly kind: "ListValue";
|
||||
readonly loc?: Location;
|
||||
readonly values: ReadonlyArray<ValueNode>;
|
||||
}
|
||||
|
||||
export interface ObjectValueNode {
|
||||
readonly kind: "ObjectValue";
|
||||
readonly loc?: Location;
|
||||
readonly fields: ReadonlyArray<ObjectFieldNode>;
|
||||
}
|
||||
|
||||
export interface ObjectFieldNode {
|
||||
readonly kind: "ObjectField";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly value: ValueNode;
|
||||
}
|
||||
|
||||
// Directives
|
||||
|
||||
export interface DirectiveNode {
|
||||
readonly kind: "Directive";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly arguments?: ReadonlyArray<ArgumentNode>;
|
||||
}
|
||||
|
||||
// Type Reference
|
||||
|
||||
export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode;
|
||||
|
||||
export interface NamedTypeNode {
|
||||
readonly kind: "NamedType";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
}
|
||||
|
||||
export interface ListTypeNode {
|
||||
readonly kind: "ListType";
|
||||
readonly loc?: Location;
|
||||
readonly type: TypeNode;
|
||||
}
|
||||
|
||||
export interface NonNullTypeNode {
|
||||
readonly kind: "NonNullType";
|
||||
readonly loc?: Location;
|
||||
readonly type: NamedTypeNode | ListTypeNode;
|
||||
}
|
||||
|
||||
// Type System Definition
|
||||
|
||||
export type TypeSystemDefinitionNode = SchemaDefinitionNode | TypeDefinitionNode | DirectiveDefinitionNode;
|
||||
|
||||
export interface SchemaDefinitionNode {
|
||||
readonly kind: "SchemaDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly operationTypes: ReadonlyArray<OperationTypeDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface OperationTypeDefinitionNode {
|
||||
readonly kind: "OperationTypeDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly operation: OperationTypeNode;
|
||||
readonly type: NamedTypeNode;
|
||||
}
|
||||
|
||||
// Type Definition
|
||||
|
||||
export type TypeDefinitionNode =
|
||||
| ScalarTypeDefinitionNode
|
||||
| ObjectTypeDefinitionNode
|
||||
| InterfaceTypeDefinitionNode
|
||||
| UnionTypeDefinitionNode
|
||||
| EnumTypeDefinitionNode
|
||||
| InputObjectTypeDefinitionNode;
|
||||
|
||||
export interface ScalarTypeDefinitionNode {
|
||||
readonly kind: "ScalarTypeDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
}
|
||||
|
||||
export interface ObjectTypeDefinitionNode {
|
||||
readonly kind: "ObjectTypeDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly interfaces?: ReadonlyArray<NamedTypeNode>;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly fields?: ReadonlyArray<FieldDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface FieldDefinitionNode {
|
||||
readonly kind: "FieldDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly arguments?: ReadonlyArray<InputValueDefinitionNode>;
|
||||
readonly type: TypeNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
}
|
||||
|
||||
export interface InputValueDefinitionNode {
|
||||
readonly kind: "InputValueDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly type: TypeNode;
|
||||
readonly defaultValue?: ValueNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
}
|
||||
|
||||
export interface InterfaceTypeDefinitionNode {
|
||||
readonly kind: "InterfaceTypeDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly fields?: ReadonlyArray<FieldDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface UnionTypeDefinitionNode {
|
||||
readonly kind: "UnionTypeDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly types?: ReadonlyArray<NamedTypeNode>;
|
||||
}
|
||||
|
||||
export interface EnumTypeDefinitionNode {
|
||||
readonly kind: "EnumTypeDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly values?: ReadonlyArray<EnumValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface EnumValueDefinitionNode {
|
||||
readonly kind: "EnumValueDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
}
|
||||
|
||||
export interface InputObjectTypeDefinitionNode {
|
||||
readonly kind: "InputObjectTypeDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly fields?: ReadonlyArray<InputValueDefinitionNode>;
|
||||
}
|
||||
|
||||
// Directive Definitions
|
||||
|
||||
export interface DirectiveDefinitionNode {
|
||||
readonly kind: "DirectiveDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly description?: StringValueNode;
|
||||
readonly name: NameNode;
|
||||
readonly arguments?: ReadonlyArray<InputValueDefinitionNode>;
|
||||
readonly repeatable: boolean;
|
||||
readonly locations: ReadonlyArray<NameNode>;
|
||||
}
|
||||
|
||||
// Type System Extensions
|
||||
|
||||
export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode;
|
||||
|
||||
export type SchemaExtensionNode = {
|
||||
readonly kind: "SchemaExtension";
|
||||
readonly loc?: Location;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly operationTypes?: ReadonlyArray<OperationTypeDefinitionNode>;
|
||||
};
|
||||
|
||||
// Type Extensions
|
||||
|
||||
export type TypeExtensionNode =
|
||||
| ScalarTypeExtensionNode
|
||||
| ObjectTypeExtensionNode
|
||||
| InterfaceTypeExtensionNode
|
||||
| UnionTypeExtensionNode
|
||||
| EnumTypeExtensionNode
|
||||
| InputObjectTypeExtensionNode;
|
||||
|
||||
export interface ScalarTypeExtensionNode {
|
||||
readonly kind: "ScalarTypeExtension";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
}
|
||||
|
||||
export interface ObjectTypeExtensionNode {
|
||||
readonly kind: "ObjectTypeExtension";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly interfaces?: ReadonlyArray<NamedTypeNode>;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly fields?: ReadonlyArray<FieldDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface InterfaceTypeExtensionNode {
|
||||
readonly kind: "InterfaceTypeExtension";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly fields?: ReadonlyArray<FieldDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface UnionTypeExtensionNode {
|
||||
readonly kind: "UnionTypeExtension";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly types?: ReadonlyArray<NamedTypeNode>;
|
||||
}
|
||||
|
||||
export interface EnumTypeExtensionNode {
|
||||
readonly kind: "EnumTypeExtension";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly values?: ReadonlyArray<EnumValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface InputObjectTypeExtensionNode {
|
||||
readonly kind: "InputObjectTypeExtension";
|
||||
readonly loc?: Location;
|
||||
readonly name: NameNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly fields?: ReadonlyArray<InputValueDefinitionNode>;
|
||||
}
|
||||
7
node_modules/@types/graphql/language/blockString.d.ts
generated
vendored
Normal file
7
node_modules/@types/graphql/language/blockString.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Produces the value of a block string from its parsed raw value, similar to
|
||||
* Coffeescript's block string, Python's docstring trim or Ruby's strip_heredoc.
|
||||
*
|
||||
* This implements the GraphQL spec's BlockStringValue() static algorithm.
|
||||
*/
|
||||
export function dedentBlockStringValue(rawString: string): string;
|
||||
35
node_modules/@types/graphql/language/directiveLocation.d.ts
generated
vendored
Normal file
35
node_modules/@types/graphql/language/directiveLocation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* The set of allowed directive location values.
|
||||
*/
|
||||
export const DirectiveLocation: _DirectiveLocation;
|
||||
|
||||
// @internal
|
||||
type _DirectiveLocation = {
|
||||
// Request Definitions
|
||||
QUERY: "QUERY";
|
||||
MUTATION: "MUTATION";
|
||||
SUBSCRIPTION: "SUBSCRIPTION";
|
||||
FIELD: "FIELD";
|
||||
FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION";
|
||||
FRAGMENT_SPREAD: "FRAGMENT_SPREAD";
|
||||
INLINE_FRAGMENT: "INLINE_FRAGMENT";
|
||||
VARIABLE_DEFINITION: "VARIABLE_DEFINITION";
|
||||
|
||||
// Type System Definitions
|
||||
SCHEMA: "SCHEMA";
|
||||
SCALAR: "SCALAR";
|
||||
OBJECT: "OBJECT";
|
||||
FIELD_DEFINITION: "FIELD_DEFINITION";
|
||||
ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION";
|
||||
INTERFACE: "INTERFACE";
|
||||
UNION: "UNION";
|
||||
ENUM: "ENUM";
|
||||
ENUM_VALUE: "ENUM_VALUE";
|
||||
INPUT_OBJECT: "INPUT_OBJECT";
|
||||
INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION";
|
||||
};
|
||||
|
||||
/**
|
||||
* The enum type representing the directive location values.
|
||||
*/
|
||||
export type DirectiveLocationEnum = _DirectiveLocation[keyof _DirectiveLocation];
|
||||
93
node_modules/@types/graphql/language/index.d.ts
generated
vendored
Normal file
93
node_modules/@types/graphql/language/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
export { getLocation, SourceLocation } from "./location";
|
||||
export { Kind, KindEnum } from "./kinds";
|
||||
export { createLexer, TokenKind, Lexer, TokenKindEnum } from "./lexer";
|
||||
export { parse, parseValue, parseType, ParseOptions } from "./parser";
|
||||
export { print } from "./printer";
|
||||
export { Source } from "./source";
|
||||
export {
|
||||
visit,
|
||||
visitInParallel,
|
||||
visitWithTypeInfo,
|
||||
getVisitFn,
|
||||
BREAK,
|
||||
// type
|
||||
ASTVisitor,
|
||||
Visitor,
|
||||
VisitFn,
|
||||
VisitorKeyMap,
|
||||
} from "./visitor";
|
||||
|
||||
export {
|
||||
Location,
|
||||
Token,
|
||||
ASTNode,
|
||||
ASTKindToNode,
|
||||
// Each kind of AST node
|
||||
NameNode,
|
||||
DocumentNode,
|
||||
DefinitionNode,
|
||||
ExecutableDefinitionNode,
|
||||
OperationDefinitionNode,
|
||||
OperationTypeNode,
|
||||
VariableDefinitionNode,
|
||||
VariableNode,
|
||||
SelectionSetNode,
|
||||
SelectionNode,
|
||||
FieldNode,
|
||||
ArgumentNode,
|
||||
FragmentSpreadNode,
|
||||
InlineFragmentNode,
|
||||
FragmentDefinitionNode,
|
||||
ValueNode,
|
||||
IntValueNode,
|
||||
FloatValueNode,
|
||||
StringValueNode,
|
||||
BooleanValueNode,
|
||||
NullValueNode,
|
||||
EnumValueNode,
|
||||
ListValueNode,
|
||||
ObjectValueNode,
|
||||
ObjectFieldNode,
|
||||
DirectiveNode,
|
||||
TypeNode,
|
||||
NamedTypeNode,
|
||||
ListTypeNode,
|
||||
NonNullTypeNode,
|
||||
TypeSystemDefinitionNode,
|
||||
SchemaDefinitionNode,
|
||||
OperationTypeDefinitionNode,
|
||||
TypeDefinitionNode,
|
||||
ScalarTypeDefinitionNode,
|
||||
ObjectTypeDefinitionNode,
|
||||
FieldDefinitionNode,
|
||||
InputValueDefinitionNode,
|
||||
InterfaceTypeDefinitionNode,
|
||||
UnionTypeDefinitionNode,
|
||||
EnumTypeDefinitionNode,
|
||||
EnumValueDefinitionNode,
|
||||
InputObjectTypeDefinitionNode,
|
||||
DirectiveDefinitionNode,
|
||||
TypeSystemExtensionNode,
|
||||
SchemaExtensionNode,
|
||||
TypeExtensionNode,
|
||||
ScalarTypeExtensionNode,
|
||||
ObjectTypeExtensionNode,
|
||||
InterfaceTypeExtensionNode,
|
||||
UnionTypeExtensionNode,
|
||||
EnumTypeExtensionNode,
|
||||
InputObjectTypeExtensionNode,
|
||||
} from "./ast";
|
||||
|
||||
export {
|
||||
isDefinitionNode,
|
||||
isExecutableDefinitionNode,
|
||||
isSelectionNode,
|
||||
isValueNode,
|
||||
isTypeNode,
|
||||
isTypeSystemDefinitionNode,
|
||||
isTypeDefinitionNode,
|
||||
isTypeSystemExtensionNode,
|
||||
isTypeExtensionNode,
|
||||
} from "./predicates";
|
||||
|
||||
export { DirectiveLocation, DirectiveLocationEnum } from "./directiveLocation";
|
||||
77
node_modules/@types/graphql/language/kinds.d.ts
generated
vendored
Normal file
77
node_modules/@types/graphql/language/kinds.d.ts
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* The set of allowed kind values for AST nodes.
|
||||
*/
|
||||
export const Kind: _Kind;
|
||||
|
||||
// @internal
|
||||
type _Kind = {
|
||||
// Name
|
||||
NAME: "Name";
|
||||
|
||||
// Document
|
||||
DOCUMENT: "Document";
|
||||
OPERATION_DEFINITION: "OperationDefinition";
|
||||
VARIABLE_DEFINITION: "VariableDefinition";
|
||||
SELECTION_SET: "SelectionSet";
|
||||
FIELD: "Field";
|
||||
ARGUMENT: "Argument";
|
||||
|
||||
// Fragments
|
||||
FRAGMENT_SPREAD: "FragmentSpread";
|
||||
INLINE_FRAGMENT: "InlineFragment";
|
||||
FRAGMENT_DEFINITION: "FragmentDefinition";
|
||||
|
||||
// Values
|
||||
VARIABLE: "Variable";
|
||||
INT: "IntValue";
|
||||
FLOAT: "FloatValue";
|
||||
STRING: "StringValue";
|
||||
BOOLEAN: "BooleanValue";
|
||||
NULL: "NullValue";
|
||||
ENUM: "EnumValue";
|
||||
LIST: "ListValue";
|
||||
OBJECT: "ObjectValue";
|
||||
OBJECT_FIELD: "ObjectField";
|
||||
|
||||
// Directives
|
||||
DIRECTIVE: "Directive";
|
||||
|
||||
// Types
|
||||
NAMED_TYPE: "NamedType";
|
||||
LIST_TYPE: "ListType";
|
||||
NON_NULL_TYPE: "NonNullType";
|
||||
|
||||
// Type System Definitions
|
||||
SCHEMA_DEFINITION: "SchemaDefinition";
|
||||
OPERATION_TYPE_DEFINITION: "OperationTypeDefinition";
|
||||
|
||||
// Type Definitions
|
||||
SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition";
|
||||
OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition";
|
||||
FIELD_DEFINITION: "FieldDefinition";
|
||||
INPUT_VALUE_DEFINITION: "InputValueDefinition";
|
||||
INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition";
|
||||
UNION_TYPE_DEFINITION: "UnionTypeDefinition";
|
||||
ENUM_TYPE_DEFINITION: "EnumTypeDefinition";
|
||||
ENUM_VALUE_DEFINITION: "EnumValueDefinition";
|
||||
INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition";
|
||||
|
||||
// Directive Definitions
|
||||
DIRECTIVE_DEFINITION: "DirectiveDefinition";
|
||||
|
||||
// Type System Extensions
|
||||
SCHEMA_EXTENSION: "SchemaExtension";
|
||||
|
||||
// Type Extensions
|
||||
SCALAR_TYPE_EXTENSION: "ScalarTypeExtension";
|
||||
OBJECT_TYPE_EXTENSION: "ObjectTypeExtension";
|
||||
INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension";
|
||||
UNION_TYPE_EXTENSION: "UnionTypeExtension";
|
||||
ENUM_TYPE_EXTENSION: "EnumTypeExtension";
|
||||
INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension";
|
||||
};
|
||||
|
||||
/**
|
||||
* The enum type representing the possible kind values of AST nodes.
|
||||
*/
|
||||
export type KindEnum = _Kind[keyof _Kind];
|
||||
94
node_modules/@types/graphql/language/lexer.d.ts
generated
vendored
Normal file
94
node_modules/@types/graphql/language/lexer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
import { Token } from "./ast";
|
||||
import { Source } from "./source";
|
||||
import { syntaxError } from "../error";
|
||||
|
||||
/**
|
||||
* Given a Source object, this returns a Lexer for that source.
|
||||
* A Lexer is a stateful stream generator in that every time
|
||||
* it is advanced, it returns the next token in the Source. Assuming the
|
||||
* source lexes, the final Token emitted by the lexer will be of kind
|
||||
* EOF, after which the lexer will repeatedly return the same EOF token
|
||||
* whenever called.
|
||||
*/
|
||||
export function createLexer<TOptions>(source: Source, options: TOptions): Lexer<TOptions>;
|
||||
|
||||
/**
|
||||
* The return type of createLexer.
|
||||
*/
|
||||
export interface Lexer<TOptions> {
|
||||
source: Source;
|
||||
options: TOptions;
|
||||
|
||||
/**
|
||||
* The previously focused non-ignored token.
|
||||
*/
|
||||
lastToken: Token;
|
||||
|
||||
/**
|
||||
* The currently focused non-ignored token.
|
||||
*/
|
||||
token: Token;
|
||||
|
||||
/**
|
||||
* The (1-indexed) line containing the current token.
|
||||
*/
|
||||
line: number;
|
||||
|
||||
/**
|
||||
* The character offset at which the current line begins.
|
||||
*/
|
||||
lineStart: number;
|
||||
|
||||
/**
|
||||
* Advances the token stream to the next non-ignored token.
|
||||
*/
|
||||
advance(): Token;
|
||||
|
||||
/**
|
||||
* Looks ahead and returns the next non-ignored token, but does not change
|
||||
* the Lexer's state.
|
||||
*/
|
||||
lookahead(): Token;
|
||||
}
|
||||
|
||||
/**
|
||||
* An exported enum describing the different kinds of tokens that the
|
||||
* lexer emits.
|
||||
*/
|
||||
export const TokenKind: _TokenKind;
|
||||
|
||||
// @internal
|
||||
type _TokenKind = {
|
||||
SOF: "<SOF>";
|
||||
EOF: "<EOF>";
|
||||
BANG: "!";
|
||||
DOLLAR: "$";
|
||||
AMP: "&";
|
||||
PAREN_L: "(";
|
||||
PAREN_R: ")";
|
||||
SPREAD: "...";
|
||||
COLON: ":";
|
||||
EQUALS: "=";
|
||||
AT: "@";
|
||||
BRACKET_L: "[";
|
||||
BRACKET_R: "]";
|
||||
BRACE_L: "{";
|
||||
PIPE: "|";
|
||||
BRACE_R: "}";
|
||||
NAME: "Name";
|
||||
INT: "Int";
|
||||
FLOAT: "Float";
|
||||
STRING: "String";
|
||||
BLOCK_STRING: "BlockString";
|
||||
COMMENT: "Comment";
|
||||
};
|
||||
|
||||
/**
|
||||
* The enum type representing the token kinds values.
|
||||
*/
|
||||
export type TokenKindEnum = _TokenKind[keyof _TokenKind];
|
||||
|
||||
/**
|
||||
* A helper function to describe a token as a string for debugging
|
||||
*/
|
||||
export function getTokenDesc(token: Token): string;
|
||||
15
node_modules/@types/graphql/language/location.d.ts
generated
vendored
Normal file
15
node_modules/@types/graphql/language/location.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Source } from "./source";
|
||||
|
||||
/**
|
||||
* Represents a location in a Source.
|
||||
*/
|
||||
export interface SourceLocation {
|
||||
readonly line: number;
|
||||
readonly column: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes a Source and a UTF-8 character offset, and returns the corresponding
|
||||
* line and column as a SourceLocation.
|
||||
*/
|
||||
export function getLocation(source: Source, position: number): SourceLocation;
|
||||
106
node_modules/@types/graphql/language/parser.d.ts
generated
vendored
Normal file
106
node_modules/@types/graphql/language/parser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from "./ast";
|
||||
import { Source } from "./source";
|
||||
import { Lexer } from "./lexer";
|
||||
|
||||
/**
|
||||
* Configuration options to control parser behavior
|
||||
*/
|
||||
export interface ParseOptions {
|
||||
/**
|
||||
* By default, the parser creates AST nodes that know the location
|
||||
* in the source that they correspond to. This configuration flag
|
||||
* disables that behavior for performance or testing.
|
||||
*/
|
||||
noLocation?: boolean;
|
||||
|
||||
/**
|
||||
* If enabled, the parser will parse empty fields sets in the Schema
|
||||
* Definition Language. Otherwise, the parser will follow the current
|
||||
* specification.
|
||||
*
|
||||
* This option is provided to ease adoption of the final SDL specification
|
||||
* and will be removed in v16.
|
||||
*/
|
||||
allowLegacySDLEmptyFields?: boolean;
|
||||
|
||||
/**
|
||||
* If enabled, the parser will parse implemented interfaces with no `&`
|
||||
* character between each interface. Otherwise, the parser will follow the
|
||||
* current specification.
|
||||
*
|
||||
* This option is provided to ease adoption of the final SDL specification
|
||||
* and will be removed in v16.
|
||||
*/
|
||||
allowLegacySDLImplementsInterfaces?: boolean;
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL:
|
||||
*
|
||||
* If enabled, the parser will understand and parse variable definitions
|
||||
* contained in a fragment definition. They'll be represented in the
|
||||
* `variableDefinitions` field of the FragmentDefinitionNode.
|
||||
*
|
||||
* The syntax is identical to normal, query-defined variables. For example:
|
||||
*
|
||||
* fragment A($var: Boolean = false) on T {
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* Note: this feature is experimental and may change or be removed in the
|
||||
* future.
|
||||
*/
|
||||
experimentalFragmentVariables?: boolean;
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL:
|
||||
*
|
||||
* If enabled, the parser understands directives on variable definitions:
|
||||
*
|
||||
* query Foo($var: String = "abc" @variable_definition_directive) {
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
experimentalVariableDefinitionDirectives?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a GraphQL source, parses it into a Document.
|
||||
* Throws GraphQLError if a syntax error is encountered.
|
||||
*/
|
||||
export function parse(source: string | Source, options?: ParseOptions): DocumentNode;
|
||||
|
||||
/**
|
||||
* Given a string containing a GraphQL value, parse the AST for that value.
|
||||
* Throws GraphQLError if a syntax error is encountered.
|
||||
*
|
||||
* This is useful within tools that operate upon GraphQL Values directly and
|
||||
* in isolation of complete GraphQL documents.
|
||||
*/
|
||||
export function parseValue(source: string | Source, options?: ParseOptions): ValueNode;
|
||||
|
||||
/**
|
||||
* Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for
|
||||
* that type.
|
||||
* Throws GraphQLError if a syntax error is encountered.
|
||||
*
|
||||
* This is useful within tools that operate upon GraphQL Types directly and
|
||||
* in isolation of complete GraphQL documents.
|
||||
*
|
||||
* Consider providing the results to the utility function: typeFromAST().
|
||||
*/
|
||||
export function parseType(source: string | Source, options?: ParseOptions): TypeNode;
|
||||
|
||||
export function parseConstValue<TOptions>(lexer: Lexer<TOptions>): ValueNode;
|
||||
|
||||
/**
|
||||
* Type :
|
||||
* - NamedType
|
||||
* - ListType
|
||||
* - NonNullType
|
||||
*/
|
||||
export function parseTypeReference<TOptions>(lexer: Lexer<TOptions>): TypeNode;
|
||||
|
||||
/**
|
||||
* NamedType : Name
|
||||
*/
|
||||
export function parseNamedType<TOptions>(lexer: Lexer<TOptions>): NamedTypeNode;
|
||||
30
node_modules/@types/graphql/language/predicates.d.ts
generated
vendored
Normal file
30
node_modules/@types/graphql/language/predicates.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
ASTNode,
|
||||
DefinitionNode,
|
||||
ExecutableDefinitionNode,
|
||||
SelectionNode,
|
||||
ValueNode,
|
||||
TypeNode,
|
||||
TypeSystemDefinitionNode,
|
||||
TypeDefinitionNode,
|
||||
TypeSystemExtensionNode,
|
||||
TypeExtensionNode,
|
||||
} from "./ast";
|
||||
|
||||
export function isDefinitionNode(node: ASTNode): node is DefinitionNode;
|
||||
|
||||
export function isExecutableDefinitionNode(node: ASTNode): node is ExecutableDefinitionNode;
|
||||
|
||||
export function isSelectionNode(node: ASTNode): node is SelectionNode;
|
||||
|
||||
export function isValueNode(node: ASTNode): node is ValueNode;
|
||||
|
||||
export function isTypeNode(node: ASTNode): node is TypeNode;
|
||||
|
||||
export function isTypeSystemDefinitionNode(node: ASTNode): node is TypeSystemDefinitionNode;
|
||||
|
||||
export function isTypeDefinitionNode(node: ASTNode): node is TypeDefinitionNode;
|
||||
|
||||
export function isTypeSystemExtensionNode(node: ASTNode): node is TypeSystemExtensionNode;
|
||||
|
||||
export function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode;
|
||||
7
node_modules/@types/graphql/language/printer.d.ts
generated
vendored
Normal file
7
node_modules/@types/graphql/language/printer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ASTNode } from "./ast";
|
||||
|
||||
/**
|
||||
* Converts an AST into a string, using one set of reasonable
|
||||
* formatting rules.
|
||||
*/
|
||||
export function print(ast: ASTNode): string;
|
||||
19
node_modules/@types/graphql/language/source.d.ts
generated
vendored
Normal file
19
node_modules/@types/graphql/language/source.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
interface Location {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A representation of source input to GraphQL.
|
||||
* `name` and `locationOffset` are optional. They are useful for clients who
|
||||
* store GraphQL documents in source files; for example, if the GraphQL input
|
||||
* starts at line 40 in a file named Foo.graphql, it might be useful for name to
|
||||
* be "Foo.graphql" and location to be `{ line: 40, column: 0 }`.
|
||||
* line and column in locationOffset are 1-indexed
|
||||
*/
|
||||
export class Source {
|
||||
body: string;
|
||||
name: string;
|
||||
locationOffset: Location;
|
||||
constructor(body: string, name?: string, locationOffset?: Location);
|
||||
}
|
||||
161
node_modules/@types/graphql/language/visitor.d.ts
generated
vendored
Normal file
161
node_modules/@types/graphql/language/visitor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { ASTNode, ASTKindToNode } from "./ast";
|
||||
import { TypeInfo } from "../utilities/TypeInfo";
|
||||
|
||||
interface EnterLeave<T> {
|
||||
readonly enter?: T;
|
||||
readonly leave?: T;
|
||||
}
|
||||
|
||||
type EnterLeaveVisitor<KindToNode, Nodes> = EnterLeave<
|
||||
VisitFn<Nodes> | { [K in keyof KindToNode]?: VisitFn<Nodes, KindToNode[K]> }
|
||||
>;
|
||||
|
||||
type ShapeMapVisitor<KindToNode, Nodes> = {
|
||||
[K in keyof KindToNode]?: VisitFn<Nodes, KindToNode[K]> | EnterLeave<VisitFn<Nodes, KindToNode[K]>>
|
||||
};
|
||||
|
||||
export type ASTVisitor = Visitor<ASTKindToNode>;
|
||||
export type Visitor<KindToNode, Nodes = KindToNode[keyof KindToNode]> =
|
||||
| EnterLeaveVisitor<KindToNode, Nodes>
|
||||
| ShapeMapVisitor<KindToNode, Nodes>;
|
||||
|
||||
/**
|
||||
* A visitor is comprised of visit functions, which are called on each node
|
||||
* during the visitor's traversal.
|
||||
*/
|
||||
export type VisitFn<TAnyNode, TVisitedNode = TAnyNode> = (
|
||||
// The current node being visiting.
|
||||
node: TVisitedNode,
|
||||
// The index or key to this node from the parent node or Array.
|
||||
key: string | number | undefined,
|
||||
// The parent immediately above this node, which may be an Array.
|
||||
parent: TAnyNode | ReadonlyArray<TAnyNode> | undefined,
|
||||
// The key path to get to this node from the root node.
|
||||
path: ReadonlyArray<string | number>,
|
||||
// All nodes and Arrays visited before reaching parent of this node.
|
||||
// These correspond to array indices in `path`.
|
||||
// Note: ancestors includes arrays which contain the parent of visited node.
|
||||
ancestors: ReadonlyArray<TAnyNode | ReadonlyArray<TAnyNode>>
|
||||
) => any;
|
||||
|
||||
/**
|
||||
* A KeyMap describes each the traversable properties of each kind of node.
|
||||
*/
|
||||
export type VisitorKeyMap<T> = { [P in keyof T]: ReadonlyArray<keyof T[P]> };
|
||||
|
||||
export const QueryDocumentKeys: { [key: string]: string[] };
|
||||
|
||||
export const BREAK: any;
|
||||
|
||||
/**
|
||||
* visit() will walk through an AST using a depth first traversal, calling
|
||||
* the visitor's enter function at each node in the traversal, and calling the
|
||||
* leave function after visiting that node and all of its child nodes.
|
||||
*
|
||||
* By returning different values from the enter and leave functions, the
|
||||
* behavior of the visitor can be altered, including skipping over a sub-tree of
|
||||
* the AST (by returning false), editing the AST by returning a value or null
|
||||
* to remove the value, or to stop the whole traversal by returning BREAK.
|
||||
*
|
||||
* When using visit() to edit an AST, the original AST will not be modified, and
|
||||
* a new version of the AST with the changes applied will be returned from the
|
||||
* visit function.
|
||||
*
|
||||
* const editedAST = visit(ast, {
|
||||
* enter(node, key, parent, path, ancestors) {
|
||||
* // @return
|
||||
* // undefined: no action
|
||||
* // false: skip visiting this node
|
||||
* // visitor.BREAK: stop visiting altogether
|
||||
* // null: delete this node
|
||||
* // any value: replace this node with the returned value
|
||||
* },
|
||||
* leave(node, key, parent, path, ancestors) {
|
||||
* // @return
|
||||
* // undefined: no action
|
||||
* // false: no action
|
||||
* // visitor.BREAK: stop visiting altogether
|
||||
* // null: delete this node
|
||||
* // any value: replace this node with the returned value
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Alternatively to providing enter() and leave() functions, a visitor can
|
||||
* instead provide functions named the same as the kinds of AST nodes, or
|
||||
* enter/leave visitors at a named key, leading to four permutations of
|
||||
* visitor API:
|
||||
*
|
||||
* 1) Named visitors triggered when entering a node a specific kind.
|
||||
*
|
||||
* visit(ast, {
|
||||
* Kind(node) {
|
||||
* // enter the "Kind" node
|
||||
* }
|
||||
* })
|
||||
*
|
||||
* 2) Named visitors that trigger upon entering and leaving a node of
|
||||
* a specific kind.
|
||||
*
|
||||
* visit(ast, {
|
||||
* Kind: {
|
||||
* enter(node) {
|
||||
* // enter the "Kind" node
|
||||
* }
|
||||
* leave(node) {
|
||||
* // leave the "Kind" node
|
||||
* }
|
||||
* }
|
||||
* })
|
||||
*
|
||||
* 3) Generic visitors that trigger upon entering and leaving any node.
|
||||
*
|
||||
* visit(ast, {
|
||||
* enter(node) {
|
||||
* // enter any node
|
||||
* },
|
||||
* leave(node) {
|
||||
* // leave any node
|
||||
* }
|
||||
* })
|
||||
*
|
||||
* 4) Parallel visitors for entering and leaving nodes of a specific kind.
|
||||
*
|
||||
* visit(ast, {
|
||||
* enter: {
|
||||
* Kind(node) {
|
||||
* // enter the "Kind" node
|
||||
* }
|
||||
* },
|
||||
* leave: {
|
||||
* Kind(node) {
|
||||
* // leave the "Kind" node
|
||||
* }
|
||||
* }
|
||||
* })
|
||||
*/
|
||||
export function visit(
|
||||
root: ASTNode,
|
||||
visitor: Visitor<ASTKindToNode>,
|
||||
visitorKeys?: VisitorKeyMap<ASTKindToNode> // default: QueryDocumentKeys
|
||||
): any;
|
||||
|
||||
/**
|
||||
* Creates a new visitor instance which delegates to many visitors to run in
|
||||
* parallel. Each visitor will be visited for each node before moving on.
|
||||
*
|
||||
* If a prior visitor edits a node, no following visitors will see that node.
|
||||
*/
|
||||
export function visitInParallel(visitors: Array<Visitor<ASTKindToNode>>): Visitor<ASTKindToNode>;
|
||||
|
||||
/**
|
||||
* Creates a new visitor instance which maintains a provided TypeInfo instance
|
||||
* along with visiting visitor.
|
||||
*/
|
||||
export function visitWithTypeInfo(typeInfo: TypeInfo, visitor: Visitor<ASTKindToNode>): Visitor<ASTKindToNode>;
|
||||
|
||||
/**
|
||||
* Given a visitor instance, if it is leaving or not, and a node kind, return
|
||||
* the function the visitor runtime should call.
|
||||
*/
|
||||
export function getVisitFn(visitor: Visitor<any>, kind: string, isLeaving: boolean): Maybe<VisitFn<any>>;
|
||||
119
node_modules/@types/graphql/package.json
generated
vendored
Normal file
119
node_modules/@types/graphql/package.json
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"name": "@types/graphql",
|
||||
"version": "14.2.3",
|
||||
"description": "TypeScript definitions for graphql",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "TonyYang",
|
||||
"url": "https://github.com/TonyPythoneer",
|
||||
"githubUsername": "TonyPythoneer"
|
||||
},
|
||||
{
|
||||
"name": "Caleb Meredith",
|
||||
"url": "https://github.com/calebmer",
|
||||
"githubUsername": "calebmer"
|
||||
},
|
||||
{
|
||||
"name": "Dominic Watson",
|
||||
"url": "https://github.com/intellix",
|
||||
"githubUsername": "intellix"
|
||||
},
|
||||
{
|
||||
"name": "Firede",
|
||||
"url": "https://github.com/firede",
|
||||
"githubUsername": "firede"
|
||||
},
|
||||
{
|
||||
"name": "Kepennar",
|
||||
"url": "https://github.com/kepennar",
|
||||
"githubUsername": "kepennar"
|
||||
},
|
||||
{
|
||||
"name": "Mikhail Novikov",
|
||||
"url": "https://github.com/freiksenet",
|
||||
"githubUsername": "freiksenet"
|
||||
},
|
||||
{
|
||||
"name": "Ivan Goncharov",
|
||||
"url": "https://github.com/IvanGoncharov",
|
||||
"githubUsername": "IvanGoncharov"
|
||||
},
|
||||
{
|
||||
"name": "Hagai Cohen",
|
||||
"url": "https://github.com/DxCx",
|
||||
"githubUsername": "DxCx"
|
||||
},
|
||||
{
|
||||
"name": "Ricardo Portugal",
|
||||
"url": "https://github.com/rportugal",
|
||||
"githubUsername": "rportugal"
|
||||
},
|
||||
{
|
||||
"name": "Tim Griesser",
|
||||
"url": "https://github.com/tgriesser",
|
||||
"githubUsername": "tgriesser"
|
||||
},
|
||||
{
|
||||
"name": "Dylan Stewart",
|
||||
"url": "https://github.com/dyst5422",
|
||||
"githubUsername": "dyst5422"
|
||||
},
|
||||
{
|
||||
"name": "Alessio Dionisi",
|
||||
"url": "https://github.com/adnsio",
|
||||
"githubUsername": "adnsio"
|
||||
},
|
||||
{
|
||||
"name": "Divyendu Singh",
|
||||
"url": "https://github.com/divyenduz",
|
||||
"githubUsername": "divyenduz"
|
||||
},
|
||||
{
|
||||
"name": "Brad Zacher",
|
||||
"url": "https://github.com/bradzacher",
|
||||
"githubUsername": "bradzacher"
|
||||
},
|
||||
{
|
||||
"name": "Curtis Layne",
|
||||
"url": "https://github.com/clayne11",
|
||||
"githubUsername": "clayne11"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Cardoso",
|
||||
"url": "https://github.com/JCMais",
|
||||
"githubUsername": "JCMais"
|
||||
},
|
||||
{
|
||||
"name": "Pavel Lang",
|
||||
"url": "https://github.com/langpavel",
|
||||
"githubUsername": "langpavel"
|
||||
},
|
||||
{
|
||||
"name": "Mark Caudill",
|
||||
"url": "https://github.com/mc0",
|
||||
"githubUsername": "mc0"
|
||||
},
|
||||
{
|
||||
"name": "Martijn Walraven",
|
||||
"url": "https://github.com/martijnwalraven",
|
||||
"githubUsername": "martijnwalraven"
|
||||
},
|
||||
{
|
||||
"name": "Jed Mao",
|
||||
"url": "https://github.com/jedmao",
|
||||
"githubUsername": "jedmao"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/graphql"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "9aa8839a3e40d2e230ae68d349603e9eba421e137eaa9a1e841de1867881c7b4",
|
||||
"typeScriptVersion": "2.6"
|
||||
}
|
||||
1
node_modules/@types/graphql/subscription/index.d.ts
generated
vendored
Normal file
1
node_modules/@types/graphql/subscription/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { subscribe, createSourceEventStream } from "./subscribe";
|
||||
75
node_modules/@types/graphql/subscription/subscribe.d.ts
generated
vendored
Normal file
75
node_modules/@types/graphql/subscription/subscribe.d.ts
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { DocumentNode } from "../language/ast";
|
||||
import { GraphQLFieldResolver } from "../type/definition";
|
||||
import { ExecutionResult, ExecutionResultDataDefault } from "../execution/execute";
|
||||
|
||||
/**
|
||||
* Implements the "Subscribe" algorithm described in the GraphQL specification.
|
||||
*
|
||||
* Returns a Promise which resolves to either an AsyncIterator (if successful)
|
||||
* or an ExecutionResult (client error). The promise will be rejected if a
|
||||
* server error occurs.
|
||||
*
|
||||
* If the client-provided arguments to this function do not result in a
|
||||
* compliant subscription, a GraphQL Response (ExecutionResult) with
|
||||
* descriptive errors and no data will be returned.
|
||||
*
|
||||
* If the the source stream could not be created due to faulty subscription
|
||||
* resolver logic or underlying systems, the promise will resolve to a single
|
||||
* ExecutionResult containing `errors` and no `data`.
|
||||
*
|
||||
* If the operation succeeded, the promise resolves to an AsyncIterator, which
|
||||
* yields a stream of ExecutionResults representing the response stream.
|
||||
*
|
||||
* Accepts either an object with named arguments, or individual arguments.
|
||||
*/
|
||||
export function subscribe<TData = ExecutionResultDataDefault>(args: {
|
||||
schema: GraphQLSchema;
|
||||
document: DocumentNode;
|
||||
rootValue?: any;
|
||||
contextValue?: any;
|
||||
variableValues?: Maybe<{ [key: string]: any }>;
|
||||
operationName?: Maybe<string>;
|
||||
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
|
||||
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
|
||||
}): Promise<AsyncIterableIterator<ExecutionResult<TData>> | ExecutionResult<TData>>;
|
||||
|
||||
export function subscribe<TData = ExecutionResultDataDefault>(
|
||||
schema: GraphQLSchema,
|
||||
document: DocumentNode,
|
||||
rootValue?: any,
|
||||
contextValue?: any,
|
||||
variableValues?: Maybe<{ [key: string]: any }>,
|
||||
operationName?: Maybe<string>,
|
||||
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>,
|
||||
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>
|
||||
): Promise<AsyncIterableIterator<ExecutionResult<TData>> | ExecutionResult<TData>>;
|
||||
|
||||
/**
|
||||
* Implements the "CreateSourceEventStream" algorithm described in the
|
||||
* GraphQL specification, resolving the subscription source event stream.
|
||||
*
|
||||
* Returns a Promise<AsyncIterable>.
|
||||
*
|
||||
* If the client-provided invalid arguments, the source stream could not be
|
||||
* created, or the resolver did not return an AsyncIterable, this function will
|
||||
* will throw an error, which should be caught and handled by the caller.
|
||||
*
|
||||
* A Source Event Stream represents a sequence of events, each of which triggers
|
||||
* a GraphQL execution for that event.
|
||||
*
|
||||
* This may be useful when hosting the stateful subscription service in a
|
||||
* different process or machine than the stateless GraphQL execution engine,
|
||||
* or otherwise separating these two steps. For more on this, see the
|
||||
* "Supporting Subscriptions at Scale" information in the GraphQL specification.
|
||||
*/
|
||||
export function createSourceEventStream<TData = ExecutionResultDataDefault>(
|
||||
schema: GraphQLSchema,
|
||||
document: DocumentNode,
|
||||
rootValue?: any,
|
||||
contextValue?: any,
|
||||
variableValues?: { [key: string]: any },
|
||||
operationName?: Maybe<string>,
|
||||
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>
|
||||
): Promise<AsyncIterable<any> | ExecutionResult<TData>>;
|
||||
4
node_modules/@types/graphql/tsutils/Maybe.d.ts
generated
vendored
Normal file
4
node_modules/@types/graphql/tsutils/Maybe.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
// Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/
|
||||
type Maybe<T> = null | undefined | T;
|
||||
|
||||
export default Maybe;
|
||||
715
node_modules/@types/graphql/type/definition.d.ts
generated
vendored
Normal file
715
node_modules/@types/graphql/type/definition.d.ts
generated
vendored
Normal file
@@ -0,0 +1,715 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { PromiseOrValue } from "../jsutils/PromiseOrValue";
|
||||
import {
|
||||
ScalarTypeDefinitionNode,
|
||||
ObjectTypeDefinitionNode,
|
||||
FieldDefinitionNode,
|
||||
InputValueDefinitionNode,
|
||||
InterfaceTypeDefinitionNode,
|
||||
UnionTypeDefinitionNode,
|
||||
EnumTypeDefinitionNode,
|
||||
EnumValueDefinitionNode,
|
||||
InputObjectTypeDefinitionNode,
|
||||
ObjectTypeExtensionNode,
|
||||
InterfaceTypeExtensionNode,
|
||||
OperationDefinitionNode,
|
||||
FieldNode,
|
||||
FragmentDefinitionNode,
|
||||
ValueNode,
|
||||
ScalarTypeExtensionNode,
|
||||
UnionTypeExtensionNode,
|
||||
EnumTypeExtensionNode,
|
||||
InputObjectTypeExtensionNode,
|
||||
} from "../language/ast";
|
||||
import { GraphQLSchema } from "./schema";
|
||||
|
||||
/**
|
||||
* These are all of the possible kinds of types.
|
||||
*/
|
||||
export type GraphQLType =
|
||||
| GraphQLScalarType
|
||||
| GraphQLObjectType
|
||||
| GraphQLInterfaceType
|
||||
| GraphQLUnionType
|
||||
| GraphQLEnumType
|
||||
| GraphQLInputObjectType
|
||||
| GraphQLList<any>
|
||||
| GraphQLNonNull<any>;
|
||||
|
||||
export function isType(type: any): type is GraphQLType;
|
||||
|
||||
export function assertType(type: any): GraphQLType;
|
||||
|
||||
export function isScalarType(type: any): type is GraphQLScalarType;
|
||||
|
||||
export function assertScalarType(type: any): GraphQLScalarType;
|
||||
|
||||
export function isObjectType(type: any): type is GraphQLObjectType;
|
||||
|
||||
export function assertObjectType(type: any): GraphQLObjectType;
|
||||
|
||||
export function isInterfaceType(type: any): type is GraphQLInterfaceType;
|
||||
|
||||
export function assertInterfaceType(type: any): GraphQLInterfaceType;
|
||||
|
||||
export function isUnionType(type: any): type is GraphQLUnionType;
|
||||
|
||||
export function assertUnionType(type: any): GraphQLUnionType;
|
||||
|
||||
export function isEnumType(type: any): type is GraphQLEnumType;
|
||||
|
||||
export function assertEnumType(type: any): GraphQLEnumType;
|
||||
|
||||
export function isInputObjectType(type: any): type is GraphQLInputObjectType;
|
||||
|
||||
export function assertInputObjectType(type: any): GraphQLInputObjectType;
|
||||
|
||||
export function isListType(type: any): type is GraphQLList<any>;
|
||||
|
||||
export function assertListType(type: any): GraphQLList<any>;
|
||||
|
||||
export function isNonNullType(type: any): type is GraphQLNonNull<any>;
|
||||
|
||||
export function assertNonNullType(type: any): GraphQLNonNull<any>;
|
||||
|
||||
/**
|
||||
* These types may be used as input types for arguments and directives.
|
||||
*/
|
||||
export type GraphQLInputType =
|
||||
| GraphQLScalarType
|
||||
| GraphQLEnumType
|
||||
| GraphQLInputObjectType
|
||||
| GraphQLList<any>
|
||||
| GraphQLNonNull<GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType | GraphQLList<any>>;
|
||||
|
||||
export function isInputType(type: any): type is GraphQLInputType;
|
||||
|
||||
export function assertInputType(type: any): GraphQLInputType;
|
||||
|
||||
/**
|
||||
* These types may be used as output types as the result of fields.
|
||||
*/
|
||||
export type GraphQLOutputType =
|
||||
| GraphQLScalarType
|
||||
| GraphQLObjectType
|
||||
| GraphQLInterfaceType
|
||||
| GraphQLUnionType
|
||||
| GraphQLEnumType
|
||||
| GraphQLList<any>
|
||||
| GraphQLNonNull<
|
||||
| GraphQLScalarType
|
||||
| GraphQLObjectType
|
||||
| GraphQLInterfaceType
|
||||
| GraphQLUnionType
|
||||
| GraphQLEnumType
|
||||
| GraphQLList<any>
|
||||
>;
|
||||
|
||||
export function isOutputType(type: any): type is GraphQLOutputType;
|
||||
|
||||
export function assertOutputType(type: any): GraphQLOutputType;
|
||||
|
||||
/**
|
||||
* These types may describe types which may be leaf values.
|
||||
*/
|
||||
export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;
|
||||
|
||||
export function isLeafType(type: any): type is GraphQLLeafType;
|
||||
|
||||
export function assertLeafType(type: any): GraphQLLeafType;
|
||||
|
||||
/**
|
||||
* These types may describe the parent context of a selection set.
|
||||
*/
|
||||
export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType;
|
||||
|
||||
export function isCompositeType(type: any): type is GraphQLCompositeType;
|
||||
|
||||
export function assertCompositeType(type: any): GraphQLCompositeType;
|
||||
|
||||
/**
|
||||
* These types may describe the parent context of a selection set.
|
||||
*/
|
||||
export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType;
|
||||
|
||||
export function isAbstractType(type: any): type is GraphQLAbstractType;
|
||||
|
||||
export function assertAbstractType(type: any): GraphQLAbstractType;
|
||||
|
||||
/**
|
||||
* List Modifier
|
||||
*
|
||||
* A list is a kind of type marker, a wrapping type which points to another
|
||||
* type. Lists are often created within the context of defining the fields
|
||||
* of an object type.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const PersonType = new GraphQLObjectType({
|
||||
* name: 'Person',
|
||||
* fields: () => ({
|
||||
* parents: { type: new GraphQLList(Person) },
|
||||
* children: { type: new GraphQLList(Person) },
|
||||
* })
|
||||
* })
|
||||
*
|
||||
*/
|
||||
interface GraphQLList<T extends GraphQLType> {
|
||||
readonly ofType: T;
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
interface _GraphQLList<T extends GraphQLType> {
|
||||
(type: T): GraphQLList<T>;
|
||||
new (type: T): GraphQLList<T>;
|
||||
}
|
||||
|
||||
export const GraphQLList: _GraphQLList<GraphQLType>;
|
||||
|
||||
/**
|
||||
* Non-Null Modifier
|
||||
*
|
||||
* A non-null is a kind of type marker, a wrapping type which points to another
|
||||
* type. Non-null types enforce that their values are never null and can ensure
|
||||
* an error is raised if this ever occurs during a request. It is useful for
|
||||
* fields which you can make a strong guarantee on non-nullability, for example
|
||||
* usually the id field of a database row will never be null.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const RowType = new GraphQLObjectType({
|
||||
* name: 'Row',
|
||||
* fields: () => ({
|
||||
* id: { type: new GraphQLNonNull(GraphQLString) },
|
||||
* })
|
||||
* })
|
||||
*
|
||||
* Note: the enforcement of non-nullability occurs within the executor.
|
||||
*/
|
||||
interface GraphQLNonNull<T extends GraphQLNullableType> {
|
||||
readonly ofType: T;
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
interface _GraphQLNonNull<T extends GraphQLNullableType> {
|
||||
(type: T): GraphQLNonNull<T>;
|
||||
new (type: T): GraphQLNonNull<T>;
|
||||
}
|
||||
|
||||
export const GraphQLNonNull: _GraphQLNonNull<GraphQLNullableType>;
|
||||
|
||||
export type GraphQLWrappingType = GraphQLList<any> | GraphQLNonNull<any>;
|
||||
|
||||
export function isWrappingType(type: any): type is GraphQLWrappingType;
|
||||
|
||||
export function assertWrappingType(type: any): GraphQLWrappingType;
|
||||
|
||||
/**
|
||||
* These types can all accept null as a value.
|
||||
*/
|
||||
export type GraphQLNullableType =
|
||||
| GraphQLScalarType
|
||||
| GraphQLObjectType
|
||||
| GraphQLInterfaceType
|
||||
| GraphQLUnionType
|
||||
| GraphQLEnumType
|
||||
| GraphQLInputObjectType
|
||||
| GraphQLList<any>;
|
||||
|
||||
export function isNullableType(type: any): type is GraphQLNullableType;
|
||||
|
||||
export function assertNullableType(type: any): GraphQLNullableType;
|
||||
|
||||
export function getNullableType(type: void): undefined;
|
||||
export function getNullableType<T extends GraphQLNullableType>(type: T): T;
|
||||
export function getNullableType<T extends GraphQLNullableType>(type: GraphQLNonNull<T>): T;
|
||||
|
||||
/**
|
||||
* These named types do not include modifiers like List or NonNull.
|
||||
*/
|
||||
export type GraphQLNamedType =
|
||||
| GraphQLScalarType
|
||||
| GraphQLObjectType
|
||||
| GraphQLInterfaceType
|
||||
| GraphQLUnionType
|
||||
| GraphQLEnumType
|
||||
| GraphQLInputObjectType;
|
||||
|
||||
export function isNamedType(type: any): type is GraphQLNamedType;
|
||||
|
||||
export function assertNamedType(type: any): GraphQLNamedType;
|
||||
|
||||
export function getNamedType(type: void): undefined;
|
||||
export function getNamedType(type: GraphQLType): GraphQLNamedType;
|
||||
|
||||
/**
|
||||
* Used while defining GraphQL types to allow for circular references in
|
||||
* otherwise immutable type definitions.
|
||||
*/
|
||||
export type Thunk<T> = (() => T) | T;
|
||||
|
||||
/**
|
||||
* Scalar Type Definition
|
||||
*
|
||||
* The leaf values of any request and input values to arguments are
|
||||
* Scalars (or Enums) and are defined with a name and a series of functions
|
||||
* used to parse input from ast or variables and to ensure validity.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const OddType = new GraphQLScalarType({
|
||||
* name: 'Odd',
|
||||
* serialize(value) {
|
||||
* return value % 2 === 1 ? value : null;
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
export class GraphQLScalarType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
serialize: GraphQLScalarSerializer<any>;
|
||||
parseValue: GraphQLScalarValueParser<any>;
|
||||
parseLiteral: GraphQLScalarLiteralParser<any>;
|
||||
astNode: Maybe<ScalarTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
|
||||
constructor(config: GraphQLScalarTypeConfig<any, any>);
|
||||
|
||||
toConfig(): GraphQLScalarTypeConfig<any, any> & {
|
||||
parseValue: GraphQLScalarValueParser<any>;
|
||||
parseLiteral: GraphQLScalarLiteralParser<any>;
|
||||
extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
|
||||
};
|
||||
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
export type GraphQLScalarSerializer<TExternal> = (value: any) => Maybe<TExternal>;
|
||||
export type GraphQLScalarValueParser<TInternal> = (value: any) => Maybe<TInternal>;
|
||||
export type GraphQLScalarLiteralParser<TInternal> = (
|
||||
valueNode: ValueNode,
|
||||
variables: Maybe<{ [key: string]: any }>
|
||||
) => Maybe<TInternal>;
|
||||
|
||||
export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
|
||||
name: string;
|
||||
description?: Maybe<string>;
|
||||
// Serializes an internal value to include in a response.
|
||||
serialize: GraphQLScalarSerializer<TExternal>;
|
||||
// Parses an externally provided value to use as an input.
|
||||
parseValue?: GraphQLScalarValueParser<TInternal>;
|
||||
// Parses an externally provided literal value to use as an input.
|
||||
parseLiteral?: GraphQLScalarLiteralParser<TInternal>;
|
||||
astNode?: Maybe<ScalarTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object Type Definition
|
||||
*
|
||||
* Almost all of the GraphQL types you define will be object types. Object types
|
||||
* have a name, but most importantly describe their fields.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const AddressType = new GraphQLObjectType({
|
||||
* name: 'Address',
|
||||
* fields: {
|
||||
* street: { type: GraphQLString },
|
||||
* number: { type: GraphQLInt },
|
||||
* formatted: {
|
||||
* type: GraphQLString,
|
||||
* resolve(obj) {
|
||||
* return obj.number + ' ' + obj.street
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* When two types need to refer to each other, or a type needs to refer to
|
||||
* itself in a field, you can use a function expression (aka a closure or a
|
||||
* thunk) to supply the fields lazily.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const PersonType = new GraphQLObjectType({
|
||||
* name: 'Person',
|
||||
* fields: () => ({
|
||||
* name: { type: GraphQLString },
|
||||
* bestFriend: { type: PersonType },
|
||||
* })
|
||||
* });
|
||||
*
|
||||
*/
|
||||
export class GraphQLObjectType<TSource = any, TContext = any, TArgs = { [key: string]: any }> {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode: Maybe<ObjectTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
|
||||
isTypeOf: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
|
||||
|
||||
constructor(config: GraphQLObjectTypeConfig<TSource, TContext, TArgs>);
|
||||
getFields(): GraphQLFieldMap<any, TContext, TArgs>;
|
||||
getInterfaces(): GraphQLInterfaceType[];
|
||||
|
||||
toConfig(): GraphQLObjectTypeConfig<any, any> & {
|
||||
interfaces: GraphQLInterfaceType[];
|
||||
fields: GraphQLFieldConfigMap<any, any>;
|
||||
extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
|
||||
};
|
||||
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
export interface GraphQLObjectTypeConfig<TSource, TContext, TArgs = { [key: string]: any }> {
|
||||
name: string;
|
||||
interfaces?: Thunk<Maybe<GraphQLInterfaceType[]>>;
|
||||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext, TArgs>>;
|
||||
isTypeOf?: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<ObjectTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
export type GraphQLTypeResolver<TSource, TContext, TArgs = { [key: string]: any }> = (
|
||||
value: TSource,
|
||||
context: TContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => PromiseOrValue<Maybe<GraphQLObjectType<TSource, TContext, TArgs> | string>>;
|
||||
|
||||
export type GraphQLIsTypeOfFn<TSource, TContext> = (
|
||||
source: TSource,
|
||||
context: TContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => PromiseOrValue<boolean>;
|
||||
|
||||
export type GraphQLFieldResolver<TSource, TContext, TArgs = { [argName: string]: any }> = (
|
||||
source: TSource,
|
||||
args: TArgs,
|
||||
context: TContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => any;
|
||||
|
||||
export interface GraphQLResolveInfo {
|
||||
readonly fieldName: string;
|
||||
readonly fieldNodes: ReadonlyArray<FieldNode>;
|
||||
readonly returnType: GraphQLOutputType;
|
||||
readonly parentType: GraphQLObjectType;
|
||||
readonly path: ResponsePath;
|
||||
readonly schema: GraphQLSchema;
|
||||
readonly fragments: { [key: string]: FragmentDefinitionNode };
|
||||
readonly rootValue: any;
|
||||
readonly operation: OperationDefinitionNode;
|
||||
readonly variableValues: { [variableName: string]: any };
|
||||
}
|
||||
|
||||
export type ResponsePath = {
|
||||
readonly prev: ResponsePath | undefined;
|
||||
readonly key: string | number;
|
||||
};
|
||||
|
||||
export interface GraphQLFieldConfig<TSource, TContext, TArgs = { [argName: string]: any }> {
|
||||
type: GraphQLOutputType;
|
||||
args?: GraphQLFieldConfigArgumentMap;
|
||||
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
||||
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
||||
deprecationReason?: Maybe<string>;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<FieldDefinitionNode>;
|
||||
}
|
||||
|
||||
export type GraphQLFieldConfigArgumentMap = { [key: string]: GraphQLArgumentConfig };
|
||||
|
||||
export interface GraphQLArgumentConfig {
|
||||
type: GraphQLInputType;
|
||||
defaultValue?: any;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<InputValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export type GraphQLFieldConfigMap<TSource, TContext, TArgs = { [key: string]: any }> = {
|
||||
[key: string]: GraphQLFieldConfig<TSource, TContext, TArgs>;
|
||||
};
|
||||
|
||||
export interface GraphQLField<TSource, TContext, TArgs = { [key: string]: any }> {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
type: GraphQLOutputType;
|
||||
args: GraphQLArgument[];
|
||||
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
||||
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
||||
isDeprecated?: boolean;
|
||||
deprecationReason?: Maybe<string>;
|
||||
astNode?: Maybe<FieldDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface GraphQLArgument {
|
||||
name: string;
|
||||
type: GraphQLInputType;
|
||||
defaultValue?: any;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<InputValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export function isRequiredArgument(arg: GraphQLArgument): boolean;
|
||||
|
||||
export type GraphQLFieldMap<TSource, TContext, TArgs = { [key: string]: any }> = {
|
||||
[key: string]: GraphQLField<TSource, TContext, TArgs>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface Type Definition
|
||||
*
|
||||
* When a field can return one of a heterogeneous set of types, a Interface type
|
||||
* is used to describe what types are possible, what fields are in common across
|
||||
* all types, as well as a function to determine which type is actually used
|
||||
* when the field is resolved.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const EntityType = new GraphQLInterfaceType({
|
||||
* name: 'Entity',
|
||||
* fields: {
|
||||
* name: { type: GraphQLString }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
export class GraphQLInterfaceType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode?: Maybe<InterfaceTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
|
||||
resolveType: Maybe<GraphQLTypeResolver<any, any>>;
|
||||
|
||||
constructor(config: GraphQLInterfaceTypeConfig<any, any>);
|
||||
|
||||
getFields(): GraphQLFieldMap<any, any>;
|
||||
|
||||
toConfig(): GraphQLInterfaceTypeConfig<any, any> & {
|
||||
fields: GraphQLFieldConfigMap<any, any>;
|
||||
extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
|
||||
};
|
||||
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
export interface GraphQLInterfaceTypeConfig<TSource, TContext, TArgs = { [key: string]: any }> {
|
||||
name: string;
|
||||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext, TArgs>>;
|
||||
/**
|
||||
* Optionally provide a custom type resolver function. If one is not provided,
|
||||
* the default implementation will call `isTypeOf` on each implementing
|
||||
* Object type.
|
||||
*/
|
||||
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext, TArgs>>;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<InterfaceTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Union Type Definition
|
||||
*
|
||||
* When a field can return one of a heterogeneous set of types, a Union type
|
||||
* is used to describe what types are possible as well as providing a function
|
||||
* to determine which type is actually used when the field is resolved.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const PetType = new GraphQLUnionType({
|
||||
* name: 'Pet',
|
||||
* types: [ DogType, CatType ],
|
||||
* resolveType(value) {
|
||||
* if (value instanceof Dog) {
|
||||
* return DogType;
|
||||
* }
|
||||
* if (value instanceof Cat) {
|
||||
* return CatType;
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
export class GraphQLUnionType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode: Maybe<UnionTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
|
||||
resolveType: Maybe<GraphQLTypeResolver<any, any>>;
|
||||
|
||||
constructor(config: GraphQLUnionTypeConfig<any, any>);
|
||||
|
||||
getTypes(): GraphQLObjectType[];
|
||||
|
||||
toConfig(): GraphQLUnionTypeConfig<any, any> & {
|
||||
types: GraphQLObjectType[];
|
||||
extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
|
||||
};
|
||||
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
export interface GraphQLUnionTypeConfig<TSource, TContext> {
|
||||
name: string;
|
||||
types: Thunk<GraphQLObjectType[]>;
|
||||
/**
|
||||
* Optionally provide a custom type resolver function. If one is not provided,
|
||||
* the default implementation will call `isTypeOf` on each implementing
|
||||
* Object type.
|
||||
*/
|
||||
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<UnionTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum Type Definition
|
||||
*
|
||||
* Some leaf values of requests and input values are Enums. GraphQL serializes
|
||||
* Enum values as strings, however internally Enums can be represented by any
|
||||
* kind of type, often integers.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const RGBType = new GraphQLEnumType({
|
||||
* name: 'RGB',
|
||||
* values: {
|
||||
* RED: { value: 0 },
|
||||
* GREEN: { value: 1 },
|
||||
* BLUE: { value: 2 }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Note: If a value is not provided in a definition, the name of the enum value
|
||||
* will be used as its internal value.
|
||||
*/
|
||||
export class GraphQLEnumType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode: Maybe<EnumTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
|
||||
|
||||
constructor(config: GraphQLEnumTypeConfig);
|
||||
getValues(): GraphQLEnumValue[];
|
||||
getValue(name: string): Maybe<GraphQLEnumValue>;
|
||||
serialize(value: any): Maybe<string>;
|
||||
parseValue(value: any): Maybe<any>;
|
||||
parseLiteral(valueNode: ValueNode, _variables: Maybe<{ [key: string]: any }>): Maybe<any>;
|
||||
|
||||
toConfig(): GraphQLEnumTypeConfig & {
|
||||
extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
|
||||
};
|
||||
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
export interface GraphQLEnumTypeConfig {
|
||||
name: string;
|
||||
values: GraphQLEnumValueConfigMap;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<EnumTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
export type GraphQLEnumValueConfigMap = { [key: string]: GraphQLEnumValueConfig };
|
||||
|
||||
export interface GraphQLEnumValueConfig {
|
||||
value?: any;
|
||||
deprecationReason?: Maybe<string>;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<EnumValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export interface GraphQLEnumValue {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
isDeprecated?: boolean;
|
||||
deprecationReason: Maybe<string>;
|
||||
astNode?: Maybe<EnumValueDefinitionNode>;
|
||||
value: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Input Object Type Definition
|
||||
*
|
||||
* An input object defines a structured collection of fields which may be
|
||||
* supplied to a field argument.
|
||||
*
|
||||
* Using `NonNull` will ensure that a value must be provided by the query
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const GeoPoint = new GraphQLInputObjectType({
|
||||
* name: 'GeoPoint',
|
||||
* fields: {
|
||||
* lat: { type: new GraphQLNonNull(GraphQLFloat) },
|
||||
* lon: { type: new GraphQLNonNull(GraphQLFloat) },
|
||||
* alt: { type: GraphQLFloat, defaultValue: 0 },
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
export class GraphQLInputObjectType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode: Maybe<InputObjectTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
|
||||
constructor(config: GraphQLInputObjectTypeConfig);
|
||||
getFields(): GraphQLInputFieldMap;
|
||||
|
||||
toConfig(): GraphQLInputObjectTypeConfig & {
|
||||
fields: GraphQLInputFieldConfigMap;
|
||||
extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
|
||||
};
|
||||
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
}
|
||||
|
||||
export interface GraphQLInputObjectTypeConfig {
|
||||
name: string;
|
||||
fields: Thunk<GraphQLInputFieldConfigMap>;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<InputObjectTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
export interface GraphQLInputFieldConfig {
|
||||
type: GraphQLInputType;
|
||||
defaultValue?: any;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<InputValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export type GraphQLInputFieldConfigMap = {
|
||||
[key: string]: GraphQLInputFieldConfig;
|
||||
};
|
||||
|
||||
export interface GraphQLInputField {
|
||||
name: string;
|
||||
type: GraphQLInputType;
|
||||
defaultValue?: any;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<InputValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export function isRequiredInputField(field: GraphQLInputField): boolean;
|
||||
|
||||
export type GraphQLInputFieldMap = { [key: string]: GraphQLInputField };
|
||||
64
node_modules/@types/graphql/type/directives.d.ts
generated
vendored
Normal file
64
node_modules/@types/graphql/type/directives.d.ts
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from "./definition";
|
||||
import { DirectiveDefinitionNode } from "../language/ast";
|
||||
import { DirectiveLocationEnum } from "../language/directiveLocation";
|
||||
|
||||
/**
|
||||
* Test if the given value is a GraphQL directive.
|
||||
*/
|
||||
export function isDirective(directive: any): directive is GraphQLDirective;
|
||||
|
||||
/**
|
||||
* Directives are used by the GraphQL runtime as a way of modifying execution
|
||||
* behavior. Type system creators will usually not create these directly.
|
||||
*/
|
||||
export class GraphQLDirective {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
locations: DirectiveLocationEnum[];
|
||||
isRepeatable: boolean;
|
||||
args: GraphQLArgument[];
|
||||
astNode: Maybe<DirectiveDefinitionNode>;
|
||||
|
||||
constructor(config: GraphQLDirectiveConfig);
|
||||
|
||||
toConfig(): GraphQLDirectiveConfig & {
|
||||
args: GraphQLFieldConfigArgumentMap;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GraphQLDirectiveConfig {
|
||||
name: string;
|
||||
description?: Maybe<string>;
|
||||
locations: DirectiveLocationEnum[];
|
||||
args?: Maybe<GraphQLFieldConfigArgumentMap>;
|
||||
isRepeatable?: Maybe<boolean>;
|
||||
astNode?: Maybe<DirectiveDefinitionNode>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to conditionally include fields or fragments.
|
||||
*/
|
||||
export const GraphQLIncludeDirective: GraphQLDirective;
|
||||
|
||||
/**
|
||||
* Used to conditionally skip (exclude) fields or fragments.
|
||||
*/
|
||||
export const GraphQLSkipDirective: GraphQLDirective;
|
||||
|
||||
/**
|
||||
* Constant string used for default reason for a deprecation.
|
||||
*/
|
||||
export const DEFAULT_DEPRECATION_REASON: "No longer supported";
|
||||
|
||||
/**
|
||||
* Used to declare element of a GraphQL schema as deprecated.
|
||||
*/
|
||||
export const GraphQLDeprecatedDirective: GraphQLDirective;
|
||||
|
||||
/**
|
||||
* The full list of specified directives.
|
||||
*/
|
||||
export const specifiedDirectives: ReadonlyArray<GraphQLDirective>;
|
||||
|
||||
export function isSpecifiedDirective(directive: GraphQLDirective): boolean;
|
||||
150
node_modules/@types/graphql/type/index.d.ts
generated
vendored
Normal file
150
node_modules/@types/graphql/type/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
export {
|
||||
// Predicate
|
||||
isSchema,
|
||||
// GraphQL Schema definition
|
||||
GraphQLSchema,
|
||||
GraphQLSchemaConfig,
|
||||
} from "./schema";
|
||||
|
||||
export {
|
||||
// Predicates
|
||||
isType,
|
||||
isScalarType,
|
||||
isObjectType,
|
||||
isInterfaceType,
|
||||
isUnionType,
|
||||
isEnumType,
|
||||
isInputObjectType,
|
||||
isListType,
|
||||
isNonNullType,
|
||||
isInputType,
|
||||
isOutputType,
|
||||
isLeafType,
|
||||
isCompositeType,
|
||||
isAbstractType,
|
||||
isWrappingType,
|
||||
isNullableType,
|
||||
isNamedType,
|
||||
isRequiredArgument,
|
||||
isRequiredInputField,
|
||||
// Assertions
|
||||
assertType,
|
||||
assertScalarType,
|
||||
assertObjectType,
|
||||
assertInterfaceType,
|
||||
assertUnionType,
|
||||
assertEnumType,
|
||||
assertInputObjectType,
|
||||
assertListType,
|
||||
assertNonNullType,
|
||||
assertInputType,
|
||||
assertOutputType,
|
||||
assertLeafType,
|
||||
assertCompositeType,
|
||||
assertAbstractType,
|
||||
assertWrappingType,
|
||||
assertNullableType,
|
||||
assertNamedType,
|
||||
// Un-modifiers
|
||||
getNullableType,
|
||||
getNamedType,
|
||||
// Definitions
|
||||
GraphQLScalarType,
|
||||
GraphQLObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLUnionType,
|
||||
GraphQLEnumType,
|
||||
GraphQLInputObjectType,
|
||||
// Type Wrappers
|
||||
GraphQLList,
|
||||
GraphQLNonNull,
|
||||
// type
|
||||
GraphQLType,
|
||||
GraphQLInputType,
|
||||
GraphQLOutputType,
|
||||
GraphQLLeafType,
|
||||
GraphQLCompositeType,
|
||||
GraphQLAbstractType,
|
||||
GraphQLWrappingType,
|
||||
GraphQLNullableType,
|
||||
GraphQLNamedType,
|
||||
Thunk,
|
||||
GraphQLArgument,
|
||||
GraphQLArgumentConfig,
|
||||
GraphQLEnumTypeConfig,
|
||||
GraphQLEnumValue,
|
||||
GraphQLEnumValueConfig,
|
||||
GraphQLEnumValueConfigMap,
|
||||
GraphQLField,
|
||||
GraphQLFieldConfig,
|
||||
GraphQLFieldConfigArgumentMap,
|
||||
GraphQLFieldConfigMap,
|
||||
GraphQLFieldMap,
|
||||
GraphQLFieldResolver,
|
||||
GraphQLInputField,
|
||||
GraphQLInputFieldConfig,
|
||||
GraphQLInputFieldConfigMap,
|
||||
GraphQLInputFieldMap,
|
||||
GraphQLInputObjectTypeConfig,
|
||||
GraphQLInterfaceTypeConfig,
|
||||
GraphQLIsTypeOfFn,
|
||||
GraphQLObjectTypeConfig,
|
||||
GraphQLResolveInfo,
|
||||
ResponsePath,
|
||||
GraphQLScalarTypeConfig,
|
||||
GraphQLTypeResolver,
|
||||
GraphQLUnionTypeConfig,
|
||||
GraphQLScalarSerializer,
|
||||
GraphQLScalarValueParser,
|
||||
GraphQLScalarLiteralParser,
|
||||
} from "./definition";
|
||||
|
||||
export {
|
||||
// Predicate
|
||||
isDirective,
|
||||
// Directives Definition
|
||||
GraphQLDirective,
|
||||
// Built-in Directives defined by the Spec
|
||||
isSpecifiedDirective,
|
||||
specifiedDirectives,
|
||||
GraphQLIncludeDirective,
|
||||
GraphQLSkipDirective,
|
||||
GraphQLDeprecatedDirective,
|
||||
// Constant Deprecation Reason
|
||||
DEFAULT_DEPRECATION_REASON,
|
||||
// type
|
||||
GraphQLDirectiveConfig,
|
||||
} from "./directives";
|
||||
|
||||
// Common built-in scalar instances.
|
||||
export {
|
||||
isSpecifiedScalarType,
|
||||
specifiedScalarTypes,
|
||||
GraphQLInt,
|
||||
GraphQLFloat,
|
||||
GraphQLString,
|
||||
GraphQLBoolean,
|
||||
GraphQLID,
|
||||
} from "./scalars";
|
||||
|
||||
export {
|
||||
// "Enum" of Type Kinds
|
||||
TypeKind,
|
||||
// GraphQL Types for introspection.
|
||||
isIntrospectionType,
|
||||
introspectionTypes,
|
||||
__Schema,
|
||||
__Directive,
|
||||
__DirectiveLocation,
|
||||
__Type,
|
||||
__Field,
|
||||
__InputValue,
|
||||
__EnumValue,
|
||||
__TypeKind,
|
||||
// Meta-field definitions.
|
||||
SchemaMetaFieldDef,
|
||||
TypeMetaFieldDef,
|
||||
TypeNameMetaFieldDef,
|
||||
} from "./introspection";
|
||||
|
||||
export { validateSchema, assertValidSchema } from "./validate";
|
||||
45
node_modules/@types/graphql/type/introspection.d.ts
generated
vendored
Normal file
45
node_modules/@types/graphql/type/introspection.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import {
|
||||
GraphQLScalarType,
|
||||
GraphQLObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLUnionType,
|
||||
GraphQLEnumType,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLList,
|
||||
GraphQLNonNull,
|
||||
} from "./definition";
|
||||
import { GraphQLField } from "./definition";
|
||||
|
||||
export const __Schema: GraphQLObjectType;
|
||||
export const __Directive: GraphQLObjectType;
|
||||
export const __DirectiveLocation: GraphQLEnumType;
|
||||
export const __Type: GraphQLObjectType;
|
||||
export const __Field: GraphQLObjectType;
|
||||
export const __InputValue: GraphQLObjectType;
|
||||
export const __EnumValue: GraphQLObjectType;
|
||||
|
||||
export const TypeKind: {
|
||||
SCALAR: "SCALAR";
|
||||
OBJECT: "OBJECT";
|
||||
INTERFACE: "INTERFACE";
|
||||
UNION: "UNION";
|
||||
ENUM: "ENUM";
|
||||
INPUT_OBJECT: "INPUT_OBJECT";
|
||||
LIST: "LIST";
|
||||
NON_NULL: "NON_NULL";
|
||||
};
|
||||
|
||||
export const __TypeKind: GraphQLEnumType;
|
||||
|
||||
/**
|
||||
* Note that these are GraphQLField and not GraphQLFieldConfig,
|
||||
* so the format for args is different.
|
||||
*/
|
||||
|
||||
export const SchemaMetaFieldDef: GraphQLField<any, any>;
|
||||
export const TypeMetaFieldDef: GraphQLField<any, any>;
|
||||
export const TypeNameMetaFieldDef: GraphQLField<any, any>;
|
||||
|
||||
export const introspectionTypes: ReadonlyArray<any>;
|
||||
|
||||
export function isIntrospectionType(type: any): boolean;
|
||||
11
node_modules/@types/graphql/type/scalars.d.ts
generated
vendored
Normal file
11
node_modules/@types/graphql/type/scalars.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { GraphQLScalarType } from "./definition";
|
||||
|
||||
export const GraphQLInt: GraphQLScalarType;
|
||||
export const GraphQLFloat: GraphQLScalarType;
|
||||
export const GraphQLString: GraphQLScalarType;
|
||||
export const GraphQLBoolean: GraphQLScalarType;
|
||||
export const GraphQLID: GraphQLScalarType;
|
||||
|
||||
export const specifiedScalarTypes: ReadonlyArray<GraphQLScalarType>;
|
||||
|
||||
export function isSpecifiedScalarType(type: GraphQLScalarType): boolean;
|
||||
93
node_modules/@types/graphql/type/schema.d.ts
generated
vendored
Normal file
93
node_modules/@types/graphql/type/schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLObjectType } from "./definition";
|
||||
import { GraphQLType, GraphQLNamedType, GraphQLAbstractType } from "./definition";
|
||||
import { SchemaDefinitionNode, SchemaExtensionNode } from "../language/ast";
|
||||
import { GraphQLDirective } from "./directives";
|
||||
|
||||
/**
|
||||
* Test if the given value is a GraphQL schema.
|
||||
*/
|
||||
export function isSchema(schema: any): schema is GraphQLSchema;
|
||||
|
||||
/**
|
||||
* Schema Definition
|
||||
*
|
||||
* A Schema is created by supplying the root types of each type of operation,
|
||||
* query and mutation (optional). A schema definition is then supplied to the
|
||||
* validator and executor.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* const MyAppSchema = new GraphQLSchema({
|
||||
* query: MyAppQueryRootType,
|
||||
* mutation: MyAppMutationRootType,
|
||||
* })
|
||||
*
|
||||
* Note: If an array of `directives` are provided to GraphQLSchema, that will be
|
||||
* the exact list of directives represented and allowed. If `directives` is not
|
||||
* provided then a default set of the specified directives (e.g. @include and
|
||||
* @skip) will be used. If you wish to provide *additional* directives to these
|
||||
* specified directives, you must explicitly declare them. Example:
|
||||
*
|
||||
* const MyAppSchema = new GraphQLSchema({
|
||||
* ...
|
||||
* directives: specifiedDirectives.concat([ myCustomDirective ]),
|
||||
* })
|
||||
*
|
||||
*/
|
||||
export class GraphQLSchema {
|
||||
astNode: Maybe<SchemaDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<SchemaExtensionNode>>;
|
||||
|
||||
constructor(config: GraphQLSchemaConfig);
|
||||
|
||||
getQueryType(): Maybe<GraphQLObjectType>;
|
||||
getMutationType(): Maybe<GraphQLObjectType>;
|
||||
getSubscriptionType(): Maybe<GraphQLObjectType>;
|
||||
getTypeMap(): TypeMap;
|
||||
getType(name: string): Maybe<GraphQLNamedType>;
|
||||
getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray<GraphQLObjectType>;
|
||||
|
||||
isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean;
|
||||
|
||||
getDirectives(): ReadonlyArray<GraphQLDirective>;
|
||||
getDirective(name: string): Maybe<GraphQLDirective>;
|
||||
|
||||
toConfig(): GraphQLSchemaConfig & {
|
||||
types: GraphQLNamedType[];
|
||||
directives: GraphQLDirective[];
|
||||
extensionASTNodes: ReadonlyArray<SchemaExtensionNode>;
|
||||
};
|
||||
}
|
||||
|
||||
type TypeMap = { [key: string]: GraphQLNamedType };
|
||||
|
||||
export interface GraphQLSchemaValidationOptions {
|
||||
/**
|
||||
* When building a schema from a GraphQL service's introspection result, it
|
||||
* might be safe to assume the schema is valid. Set to true to assume the
|
||||
* produced schema is valid.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
assumeValid?: boolean;
|
||||
|
||||
/**
|
||||
* If provided, the schema will consider fields or types with names included
|
||||
* in this list valid, even if they do not adhere to the specification's
|
||||
* schema validation rules.
|
||||
*
|
||||
* This option is provided to ease adoption and will be removed in v15.
|
||||
*/
|
||||
allowedLegacyNames?: Maybe<ReadonlyArray<string>>;
|
||||
}
|
||||
|
||||
export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {
|
||||
query: Maybe<GraphQLObjectType>;
|
||||
mutation?: Maybe<GraphQLObjectType>;
|
||||
subscription?: Maybe<GraphQLObjectType>;
|
||||
types?: Maybe<GraphQLNamedType[]>;
|
||||
directives?: Maybe<GraphQLDirective[]>;
|
||||
astNode?: Maybe<SchemaDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<SchemaExtensionNode>>;
|
||||
}
|
||||
17
node_modules/@types/graphql/type/validate.d.ts
generated
vendored
Normal file
17
node_modules/@types/graphql/type/validate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { GraphQLSchema } from "./schema";
|
||||
import { GraphQLError } from "../error/GraphQLError";
|
||||
|
||||
/**
|
||||
* Implements the "Type Validation" sub-sections of the specification's
|
||||
* "Type System" section.
|
||||
*
|
||||
* Validation runs synchronously, returning an array of encountered errors, or
|
||||
* an empty array if no errors were encountered and the Schema is valid.
|
||||
*/
|
||||
export function validateSchema(schema: GraphQLSchema): ReadonlyArray<GraphQLError>;
|
||||
|
||||
/**
|
||||
* Utility function which asserts a schema is valid by throwing an error if
|
||||
* it is invalid.
|
||||
*/
|
||||
export function assertValidSchema(schema: GraphQLSchema): void;
|
||||
49
node_modules/@types/graphql/utilities/TypeInfo.d.ts
generated
vendored
Normal file
49
node_modules/@types/graphql/utilities/TypeInfo.d.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import {
|
||||
GraphQLOutputType,
|
||||
GraphQLCompositeType,
|
||||
GraphQLInputType,
|
||||
GraphQLField,
|
||||
GraphQLArgument,
|
||||
GraphQLEnumValue,
|
||||
GraphQLType,
|
||||
} from "../type/definition";
|
||||
import { GraphQLDirective } from "../type/directives";
|
||||
import { ASTNode, FieldNode } from "../language/ast";
|
||||
|
||||
/**
|
||||
* TypeInfo is a utility class which, given a GraphQL schema, can keep track
|
||||
* of the current field and type definitions at any point in a GraphQL document
|
||||
* AST during a recursive descent by calling `enter(node)` and `leave(node)`.
|
||||
*/
|
||||
export class TypeInfo {
|
||||
constructor(
|
||||
schema: GraphQLSchema,
|
||||
// NOTE: this experimental optional second parameter is only needed in order
|
||||
// to support non-spec-compliant codebases. You should never need to use it.
|
||||
// It may disappear in the future.
|
||||
getFieldDefFn?: getFieldDef,
|
||||
// Initial type may be provided in rare cases to facilitate traversals
|
||||
// beginning somewhere other than documents.
|
||||
initialType?: GraphQLType
|
||||
);
|
||||
|
||||
getType(): Maybe<GraphQLOutputType>;
|
||||
getParentType(): Maybe<GraphQLCompositeType>;
|
||||
getInputType(): Maybe<GraphQLInputType>;
|
||||
getParentInputType(): Maybe<GraphQLInputType>;
|
||||
getFieldDef(): GraphQLField<any, Maybe<any>>;
|
||||
getDefaultValue(): Maybe<any>;
|
||||
getDirective(): Maybe<GraphQLDirective>;
|
||||
getArgument(): Maybe<GraphQLArgument>;
|
||||
getEnumValue(): Maybe<GraphQLEnumValue>;
|
||||
enter(node: ASTNode): any;
|
||||
leave(node: ASTNode): any;
|
||||
}
|
||||
|
||||
type getFieldDef = (
|
||||
schema: GraphQLSchema,
|
||||
parentType: GraphQLType,
|
||||
fieldNode: FieldNode
|
||||
) => Maybe<GraphQLField<any, any>>;
|
||||
12
node_modules/@types/graphql/utilities/assertValidName.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/utilities/assertValidName.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { GraphQLError } from "../error/GraphQLError";
|
||||
import { ASTNode } from "../language/ast";
|
||||
|
||||
/**
|
||||
* Upholds the spec rules about naming.
|
||||
*/
|
||||
export function assertValidName(name: string): string;
|
||||
|
||||
/**
|
||||
* Returns an Error if a name is invalid.
|
||||
*/
|
||||
export function isValidNameError(name: string, node?: ASTNode | undefined): GraphQLError | undefined;
|
||||
22
node_modules/@types/graphql/utilities/astFromValue.d.ts
generated
vendored
Normal file
22
node_modules/@types/graphql/utilities/astFromValue.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { ValueNode } from "../language/ast";
|
||||
import { GraphQLInputType } from "../type/definition";
|
||||
|
||||
/**
|
||||
* Produces a GraphQL Value AST given a JavaScript value.
|
||||
*
|
||||
* A GraphQL type must be provided, which will be used to interpret different
|
||||
* JavaScript values.
|
||||
*
|
||||
* | JSON Value | GraphQL Value |
|
||||
* | ------------- | -------------------- |
|
||||
* | Object | Input Object |
|
||||
* | Array | List |
|
||||
* | Boolean | Boolean |
|
||||
* | String | String / Enum Value |
|
||||
* | Number | Int / Float |
|
||||
* | Mixed | Enum Value |
|
||||
* | null | NullValue |
|
||||
*
|
||||
*/
|
||||
export function astFromValue(value: any, type: GraphQLInputType): Maybe<ValueNode>;
|
||||
95
node_modules/@types/graphql/utilities/buildASTSchema.d.ts
generated
vendored
Normal file
95
node_modules/@types/graphql/utilities/buildASTSchema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import {
|
||||
DocumentNode,
|
||||
Location,
|
||||
StringValueNode,
|
||||
TypeDefinitionNode,
|
||||
NamedTypeNode,
|
||||
DirectiveDefinitionNode,
|
||||
FieldDefinitionNode,
|
||||
InputValueDefinitionNode,
|
||||
EnumValueDefinitionNode,
|
||||
} from "../language/ast";
|
||||
import { GraphQLNamedType, GraphQLFieldConfig, GraphQLInputField, GraphQLEnumValueConfig } from "../type/definition";
|
||||
import { GraphQLDirective } from "../type/directives";
|
||||
import { Source } from "../language/source";
|
||||
import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema";
|
||||
import { ParseOptions } from "../language/parser";
|
||||
import { dedentBlockStringValue } from "../language/blockString";
|
||||
|
||||
interface BuildSchemaOptions extends GraphQLSchemaValidationOptions {
|
||||
/**
|
||||
* Descriptions are defined as preceding string literals, however an older
|
||||
* experimental version of the SDL supported preceding comments as
|
||||
* descriptions. Set to true to enable this deprecated behavior.
|
||||
* This option is provided to ease adoption and will be removed in v16.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
commentDescriptions?: boolean;
|
||||
|
||||
/**
|
||||
* Set to true to assume the SDL is valid.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
assumeValidSDL?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* This takes the ast of a schema document produced by the parse function in
|
||||
* src/language/parser.js.
|
||||
*
|
||||
* If no schema definition is provided, then it will look for types named Query
|
||||
* and Mutation.
|
||||
*
|
||||
* Given that AST it constructs a GraphQLSchema. The resulting schema
|
||||
* has no resolve methods, so execution will use default resolvers.
|
||||
*
|
||||
* Accepts options as a second argument:
|
||||
*
|
||||
* - commentDescriptions:
|
||||
* Provide true to use preceding comments as the description.
|
||||
*
|
||||
*/
|
||||
export function buildASTSchema(documentAST: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema;
|
||||
|
||||
type TypeDefinitionsMap = { [key: string]: TypeDefinitionNode };
|
||||
type TypeResolver = (typeRef: NamedTypeNode) => GraphQLNamedType;
|
||||
|
||||
export class ASTDefinitionBuilder {
|
||||
constructor(typeDefinitionsMap: TypeDefinitionsMap, options: Maybe<BuildSchemaOptions>, resolveType: TypeResolver);
|
||||
|
||||
buildTypes(nodes: ReadonlyArray<NamedTypeNode | TypeDefinitionNode>): Array<GraphQLNamedType>;
|
||||
|
||||
buildType(node: NamedTypeNode | TypeDefinitionNode): GraphQLNamedType;
|
||||
|
||||
buildDirective(directiveNode: DirectiveDefinitionNode): GraphQLDirective;
|
||||
|
||||
buildField(field: FieldDefinitionNode): GraphQLFieldConfig<any, any>;
|
||||
|
||||
buildInputField(value: InputValueDefinitionNode): GraphQLInputField;
|
||||
|
||||
buildEnumValue(value: EnumValueDefinitionNode): GraphQLEnumValueConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an ast node, returns its string description.
|
||||
* @deprecated: provided to ease adoption and will be removed in v16.
|
||||
*
|
||||
* Accepts options as a second argument:
|
||||
*
|
||||
* - commentDescriptions:
|
||||
* Provide true to use preceding comments as the description.
|
||||
*
|
||||
*/
|
||||
export function getDescription(
|
||||
node: { readonly description?: StringValueNode; readonly loc?: Location },
|
||||
options: Maybe<BuildSchemaOptions>
|
||||
): string | undefined;
|
||||
|
||||
/**
|
||||
* A helper function to build a GraphQLSchema directly from a source
|
||||
* document.
|
||||
*/
|
||||
export function buildSchema(source: string | Source, options?: BuildSchemaOptions & ParseOptions): GraphQLSchema;
|
||||
18
node_modules/@types/graphql/utilities/buildClientSchema.d.ts
generated
vendored
Normal file
18
node_modules/@types/graphql/utilities/buildClientSchema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IntrospectionQuery } from "./introspectionQuery";
|
||||
import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema";
|
||||
|
||||
interface Options extends GraphQLSchemaValidationOptions {}
|
||||
|
||||
/**
|
||||
* Build a GraphQLSchema for use by client tools.
|
||||
*
|
||||
* Given the result of a client running the introspection query, creates and
|
||||
* returns a GraphQLSchema instance which can be then used with all graphql-js
|
||||
* tools, but cannot be used to execute a query, as introspection does not
|
||||
* represent the "resolver", "parse" or "serialize" functions or any other
|
||||
* server-internal mechanisms.
|
||||
*
|
||||
* This function expects a complete introspection result. Don't forget to check
|
||||
* the "errors" field of a server response before calling this function.
|
||||
*/
|
||||
export function buildClientSchema(introspection: IntrospectionQuery, options?: Options): GraphQLSchema;
|
||||
22
node_modules/@types/graphql/utilities/coerceValue.d.ts
generated
vendored
Normal file
22
node_modules/@types/graphql/utilities/coerceValue.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { GraphQLError } from "../error/GraphQLError";
|
||||
import { ASTNode } from "../language/ast";
|
||||
import { GraphQLInputType } from "../type/definition";
|
||||
|
||||
interface CoercedValue {
|
||||
readonly errors: ReadonlyArray<GraphQLError> | undefined;
|
||||
readonly value: any;
|
||||
}
|
||||
|
||||
interface Path {
|
||||
readonly prev: Path | undefined;
|
||||
readonly key: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerces a JavaScript value given a GraphQL Type.
|
||||
*
|
||||
* Returns either a value which is valid for the provided type or a list of
|
||||
* encountered coercion errors.
|
||||
*
|
||||
*/
|
||||
export function coerceValue(value: any, type: GraphQLInputType, blameNode?: ASTNode, path?: Path): CoercedValue;
|
||||
8
node_modules/@types/graphql/utilities/concatAST.d.ts
generated
vendored
Normal file
8
node_modules/@types/graphql/utilities/concatAST.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { DocumentNode } from "../language/ast";
|
||||
|
||||
/**
|
||||
* Provided a collection of ASTs, presumably each from different files,
|
||||
* concatenate the ASTs together into batched AST, useful for validating many
|
||||
* GraphQL source files which together represent one conceptual application.
|
||||
*/
|
||||
export function concatAST(asts: ReadonlyArray<DocumentNode>): DocumentNode;
|
||||
42
node_modules/@types/graphql/utilities/extendSchema.d.ts
generated
vendored
Normal file
42
node_modules/@types/graphql/utilities/extendSchema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { DocumentNode } from "../language/ast";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { GraphQLSchemaValidationOptions } from "../type/schema";
|
||||
|
||||
interface Options extends GraphQLSchemaValidationOptions {
|
||||
/**
|
||||
* Descriptions are defined as preceding string literals, however an older
|
||||
* experimental version of the SDL supported preceding comments as
|
||||
* descriptions. Set to true to enable this deprecated behavior.
|
||||
* This option is provided to ease adoption and will be removed in v16.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
commentDescriptions?: boolean;
|
||||
|
||||
/**
|
||||
* Set to true to assume the SDL is valid.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
assumeValidSDL?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a new schema given an existing schema and a document which may
|
||||
* contain GraphQL type extensions and definitions. The original schema will
|
||||
* remain unaltered.
|
||||
*
|
||||
* Because a schema represents a graph of references, a schema cannot be
|
||||
* extended without effectively making an entire copy. We do not know until it's
|
||||
* too late if subgraphs remain unchanged.
|
||||
*
|
||||
* This algorithm copies the provided schema, applying extensions while
|
||||
* producing the copy. The original schema remains unaltered.
|
||||
*
|
||||
* Accepts options as a third argument:
|
||||
*
|
||||
* - commentDescriptions:
|
||||
* Provide true to use preceding comments as the description.
|
||||
*
|
||||
*/
|
||||
export function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode, options?: Options): GraphQLSchema;
|
||||
160
node_modules/@types/graphql/utilities/findBreakingChanges.d.ts
generated
vendored
Normal file
160
node_modules/@types/graphql/utilities/findBreakingChanges.d.ts
generated
vendored
Normal file
@@ -0,0 +1,160 @@
|
||||
import {
|
||||
getNamedType,
|
||||
GraphQLScalarType,
|
||||
GraphQLEnumType,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLObjectType,
|
||||
GraphQLUnionType,
|
||||
GraphQLNamedType,
|
||||
} from "../type/definition";
|
||||
import { GraphQLDirective } from "../type/directives";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { DirectiveLocationEnum } from "../language/directiveLocation";
|
||||
|
||||
export const BreakingChangeType: _BreakingChangeType;
|
||||
|
||||
// @internal
|
||||
type _BreakingChangeType = {
|
||||
FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND";
|
||||
FIELD_REMOVED: "FIELD_REMOVED";
|
||||
TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND";
|
||||
TYPE_REMOVED: "TYPE_REMOVED";
|
||||
TYPE_REMOVED_FROM_UNION: "TYPE_REMOVED_FROM_UNION";
|
||||
VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM";
|
||||
ARG_REMOVED: "ARG_REMOVED";
|
||||
ARG_CHANGED_KIND: "ARG_CHANGED_KIND";
|
||||
REQUIRED_ARG_ADDED: "REQUIRED_ARG_ADDED";
|
||||
REQUIRED_INPUT_FIELD_ADDED: "REQUIRED_INPUT_FIELD_ADDED";
|
||||
INTERFACE_REMOVED_FROM_OBJECT: "INTERFACE_REMOVED_FROM_OBJECT";
|
||||
DIRECTIVE_REMOVED: "DIRECTIVE_REMOVED";
|
||||
DIRECTIVE_ARG_REMOVED: "DIRECTIVE_ARG_REMOVED";
|
||||
DIRECTIVE_LOCATION_REMOVED: "DIRECTIVE_LOCATION_REMOVED";
|
||||
REQUIRED_DIRECTIVE_ARG_ADDED: "REQUIRED_DIRECTIVE_ARG_ADDED";
|
||||
};
|
||||
|
||||
export const DangerousChangeType: _DangerousChangeType;
|
||||
|
||||
// @internal
|
||||
type _DangerousChangeType = {
|
||||
ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE";
|
||||
VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM";
|
||||
INTERFACE_ADDED_TO_OBJECT: "INTERFACE_ADDED_TO_OBJECT";
|
||||
TYPE_ADDED_TO_UNION: "TYPE_ADDED_TO_UNION";
|
||||
OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED";
|
||||
OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED";
|
||||
};
|
||||
|
||||
export interface BreakingChange {
|
||||
type: keyof _BreakingChangeType;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface DangerousChange {
|
||||
type: keyof _DangerousChangeType;
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of all the types
|
||||
* of breaking changes covered by the other functions down below.
|
||||
*/
|
||||
export function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<BreakingChange>;
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of all the types
|
||||
* of potentially dangerous changes covered by the other functions down below.
|
||||
*/
|
||||
export function findDangerousChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<DangerousChange>;
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of any breaking
|
||||
* changes in the newSchema related to removing an entire type.
|
||||
*/
|
||||
export function findRemovedTypes(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<BreakingChange>;
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of any breaking
|
||||
* changes in the newSchema related to changing the type of a type.
|
||||
*/
|
||||
export function findTypesThatChangedKind(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<BreakingChange>;
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of any
|
||||
* breaking or dangerous changes in the newSchema related to arguments
|
||||
* (such as removal or change of type of an argument, or a change in an
|
||||
* argument's default value).
|
||||
*/
|
||||
export function findArgChanges(
|
||||
oldSchema: GraphQLSchema,
|
||||
newSchema: GraphQLSchema
|
||||
): {
|
||||
breakingChanges: Array<BreakingChange>;
|
||||
dangerousChanges: Array<DangerousChange>;
|
||||
};
|
||||
|
||||
export function findFieldsThatChangedTypeOnObjectOrInterfaceTypes(
|
||||
oldSchema: GraphQLSchema,
|
||||
newSchema: GraphQLSchema
|
||||
): Array<BreakingChange>;
|
||||
|
||||
export function findFieldsThatChangedTypeOnInputObjectTypes(
|
||||
oldSchema: GraphQLSchema,
|
||||
newSchema: GraphQLSchema
|
||||
): {
|
||||
breakingChanges: Array<BreakingChange>;
|
||||
dangerousChanges: Array<DangerousChange>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of any breaking
|
||||
* changes in the newSchema related to removing types from a union type.
|
||||
*/
|
||||
export function findTypesRemovedFromUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<BreakingChange>;
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of any dangerous
|
||||
* changes in the newSchema related to adding types to a union type.
|
||||
*/
|
||||
export function findTypesAddedToUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<DangerousChange>;
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of any breaking
|
||||
* changes in the newSchema related to removing values from an enum type.
|
||||
*/
|
||||
export function findValuesRemovedFromEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<BreakingChange>;
|
||||
|
||||
/**
|
||||
* Given two schemas, returns an Array containing descriptions of any dangerous
|
||||
* changes in the newSchema related to adding values to an enum type.
|
||||
*/
|
||||
export function findValuesAddedToEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<DangerousChange>;
|
||||
|
||||
export function findInterfacesRemovedFromObjectTypes(
|
||||
oldSchema: GraphQLSchema,
|
||||
newSchema: GraphQLSchema
|
||||
): Array<BreakingChange>;
|
||||
|
||||
export function findInterfacesAddedToObjectTypes(
|
||||
oldSchema: GraphQLSchema,
|
||||
newSchema: GraphQLSchema
|
||||
): Array<DangerousChange>;
|
||||
|
||||
export function findRemovedDirectives(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<BreakingChange>;
|
||||
|
||||
export function findRemovedDirectiveArgs(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array<BreakingChange>;
|
||||
|
||||
export function findAddedNonNullDirectiveArgs(
|
||||
oldSchema: GraphQLSchema,
|
||||
newSchema: GraphQLSchema
|
||||
): Array<BreakingChange>;
|
||||
|
||||
export function findRemovedLocationsForDirective(
|
||||
oldDirective: GraphQLDirective,
|
||||
newDirective: GraphQLDirective
|
||||
): Array<DirectiveLocationEnum>;
|
||||
|
||||
export function findRemovedDirectiveLocations(
|
||||
oldSchema: GraphQLSchema,
|
||||
newSchema: GraphQLSchema
|
||||
): Array<BreakingChange>;
|
||||
10
node_modules/@types/graphql/utilities/findDeprecatedUsages.d.ts
generated
vendored
Normal file
10
node_modules/@types/graphql/utilities/findDeprecatedUsages.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { DocumentNode } from "../language/ast";
|
||||
import { GraphQLError } from "../error/GraphQLError";
|
||||
|
||||
/**
|
||||
* A validation rule which reports deprecated usages.
|
||||
*
|
||||
* Returns a list of GraphQLError instances describing each deprecated use.
|
||||
*/
|
||||
export function findDeprecatedUsages(schema: GraphQLSchema, ast: DocumentNode): GraphQLError[];
|
||||
12
node_modules/@types/graphql/utilities/getOperationAST.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/utilities/getOperationAST.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { DocumentNode, OperationDefinitionNode } from "../language/ast";
|
||||
|
||||
/**
|
||||
* Returns an operation AST given a document AST and optionally an operation
|
||||
* name. If a name is not provided, an operation is only returned if only one is
|
||||
* provided in the document.
|
||||
*/
|
||||
export function getOperationAST(
|
||||
documentAST: DocumentNode,
|
||||
operationName: Maybe<string>
|
||||
): Maybe<OperationDefinitionNode>;
|
||||
11
node_modules/@types/graphql/utilities/getOperationRootType.d.ts
generated
vendored
Normal file
11
node_modules/@types/graphql/utilities/getOperationRootType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { OperationDefinitionNode, OperationTypeDefinitionNode } from "../language/ast";
|
||||
import { GraphQLObjectType } from "../type/definition";
|
||||
|
||||
/**
|
||||
* Extracts the root type of the operation from the schema.
|
||||
*/
|
||||
export function getOperationRootType(
|
||||
schema: GraphQLSchema,
|
||||
operation: OperationDefinitionNode | OperationTypeDefinitionNode
|
||||
): GraphQLObjectType;
|
||||
112
node_modules/@types/graphql/utilities/index.d.ts
generated
vendored
Normal file
112
node_modules/@types/graphql/utilities/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
// The GraphQL query recommended for a full schema introspection.
|
||||
export {
|
||||
getIntrospectionQuery,
|
||||
// @deprecated, use getIntrospectionQuery() - will be removed in v15
|
||||
introspectionQuery,
|
||||
} from "./introspectionQuery";
|
||||
|
||||
export {
|
||||
IntrospectionOptions,
|
||||
IntrospectionQuery,
|
||||
IntrospectionSchema,
|
||||
IntrospectionType,
|
||||
IntrospectionInputType,
|
||||
IntrospectionOutputType,
|
||||
IntrospectionScalarType,
|
||||
IntrospectionObjectType,
|
||||
IntrospectionInterfaceType,
|
||||
IntrospectionUnionType,
|
||||
IntrospectionEnumType,
|
||||
IntrospectionInputObjectType,
|
||||
IntrospectionTypeRef,
|
||||
IntrospectionInputTypeRef,
|
||||
IntrospectionOutputTypeRef,
|
||||
IntrospectionNamedTypeRef,
|
||||
IntrospectionListTypeRef,
|
||||
IntrospectionNonNullTypeRef,
|
||||
IntrospectionField,
|
||||
IntrospectionInputValue,
|
||||
IntrospectionEnumValue,
|
||||
IntrospectionDirective,
|
||||
} from "./introspectionQuery";
|
||||
|
||||
// Gets the target Operation from a Document
|
||||
export { getOperationAST } from "./getOperationAST";
|
||||
|
||||
// Gets the Type for the target Operation AST.
|
||||
export { getOperationRootType } from "./getOperationRootType";
|
||||
|
||||
// Convert a GraphQLSchema to an IntrospectionQuery
|
||||
export { introspectionFromSchema } from "./introspectionFromSchema";
|
||||
|
||||
// Build a GraphQLSchema from an introspection result.
|
||||
export { buildClientSchema } from "./buildClientSchema";
|
||||
|
||||
// Build a GraphQLSchema from GraphQL Schema language.
|
||||
export {
|
||||
buildASTSchema,
|
||||
buildSchema,
|
||||
// @deprecated: Get the description from a schema AST node and supports legacy
|
||||
// syntax for specifying descriptions - will be removed in v16
|
||||
getDescription,
|
||||
BuildSchemaOptions,
|
||||
} from "./buildASTSchema";
|
||||
|
||||
// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.
|
||||
export { extendSchema } from "./extendSchema";
|
||||
|
||||
// Sort a GraphQLSchema.
|
||||
export { lexicographicSortSchema } from "./lexicographicSortSchema";
|
||||
|
||||
// Print a GraphQLSchema to GraphQL Schema language.
|
||||
export { printSchema, printType, printIntrospectionSchema } from "./schemaPrinter";
|
||||
|
||||
// Create a GraphQLType from a GraphQL language AST.
|
||||
export { typeFromAST } from "./typeFromAST";
|
||||
|
||||
// Create a JavaScript value from a GraphQL language AST with a type.
|
||||
export { valueFromAST } from "./valueFromAST";
|
||||
|
||||
// Create a JavaScript value from a GraphQL language AST without a type.
|
||||
export { valueFromASTUntyped } from "./valueFromASTUntyped";
|
||||
|
||||
// Create a GraphQL language AST from a JavaScript value.
|
||||
export { astFromValue } from "./astFromValue";
|
||||
|
||||
// A helper to use within recursive-descent visitors which need to be aware of
|
||||
// the GraphQL type system.
|
||||
export { TypeInfo } from "./TypeInfo";
|
||||
|
||||
// Coerces a JavaScript value to a GraphQL type, or produces errors.
|
||||
export { coerceValue } from "./coerceValue";
|
||||
|
||||
// @deprecated use coerceValue - will be removed in v15
|
||||
export { isValidJSValue } from "./isValidJSValue";
|
||||
|
||||
// @deprecated use validation - will be removed in v15
|
||||
export { isValidLiteralValue } from "./isValidLiteralValue";
|
||||
|
||||
// Concatenates multiple AST together.
|
||||
export { concatAST } from "./concatAST";
|
||||
|
||||
// Separates an AST into an AST per Operation.
|
||||
export { separateOperations } from "./separateOperations";
|
||||
|
||||
// Comparators for types
|
||||
export { isEqualType, isTypeSubTypeOf, doTypesOverlap } from "./typeComparators";
|
||||
|
||||
// Asserts that a string is a valid GraphQL name
|
||||
export { assertValidName, isValidNameError } from "./assertValidName";
|
||||
|
||||
// Compares two GraphQLSchemas and detects breaking changes.
|
||||
export {
|
||||
BreakingChangeType,
|
||||
DangerousChangeType,
|
||||
findBreakingChanges,
|
||||
findDangerousChanges,
|
||||
BreakingChange,
|
||||
DangerousChange,
|
||||
} from "./findBreakingChanges";
|
||||
|
||||
// Report all deprecated usage within a GraphQL document.
|
||||
export { findDeprecatedUsages } from "./findDeprecatedUsages";
|
||||
13
node_modules/@types/graphql/utilities/introspectionFromSchema.d.ts
generated
vendored
Normal file
13
node_modules/@types/graphql/utilities/introspectionFromSchema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { IntrospectionQuery, IntrospectionOptions } from "./introspectionQuery";
|
||||
|
||||
/**
|
||||
* Build an IntrospectionQuery from a GraphQLSchema
|
||||
*
|
||||
* IntrospectionQuery is useful for utilities that care about type and field
|
||||
* relationships, but do not need to traverse through those relationships.
|
||||
*
|
||||
* This is the inverse of buildClientSchema. The primary use case is outside
|
||||
* of the server context, for instance when doing schema comparisons.
|
||||
*/
|
||||
export function introspectionFromSchema(schema: GraphQLSchema, options?: IntrospectionOptions): IntrospectionQuery;
|
||||
149
node_modules/@types/graphql/utilities/introspectionQuery.d.ts
generated
vendored
Normal file
149
node_modules/@types/graphql/utilities/introspectionQuery.d.ts
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { DirectiveLocationEnum } from "../language/directiveLocation";
|
||||
|
||||
export interface IntrospectionOptions {
|
||||
// Whether to include descriptions in the introspection result.
|
||||
// Default: true
|
||||
descriptions: boolean;
|
||||
}
|
||||
|
||||
export function getIntrospectionQuery(options?: IntrospectionOptions): string;
|
||||
|
||||
/**
|
||||
* Deprecated, call getIntrospectionQuery directly.
|
||||
*
|
||||
* This function will be removed in v15
|
||||
*/
|
||||
export const introspectionQuery: string;
|
||||
|
||||
export interface IntrospectionQuery {
|
||||
readonly __schema: IntrospectionSchema;
|
||||
}
|
||||
|
||||
export interface IntrospectionSchema {
|
||||
readonly queryType: IntrospectionNamedTypeRef<IntrospectionObjectType>;
|
||||
readonly mutationType: Maybe<IntrospectionNamedTypeRef<IntrospectionObjectType>>;
|
||||
readonly subscriptionType: Maybe<IntrospectionNamedTypeRef<IntrospectionObjectType>>;
|
||||
readonly types: ReadonlyArray<IntrospectionType>;
|
||||
readonly directives: ReadonlyArray<IntrospectionDirective>;
|
||||
}
|
||||
|
||||
export type IntrospectionType =
|
||||
| IntrospectionScalarType
|
||||
| IntrospectionObjectType
|
||||
| IntrospectionInterfaceType
|
||||
| IntrospectionUnionType
|
||||
| IntrospectionEnumType
|
||||
| IntrospectionInputObjectType;
|
||||
|
||||
export type IntrospectionOutputType =
|
||||
| IntrospectionScalarType
|
||||
| IntrospectionObjectType
|
||||
| IntrospectionInterfaceType
|
||||
| IntrospectionUnionType
|
||||
| IntrospectionEnumType;
|
||||
|
||||
export type IntrospectionInputType = IntrospectionScalarType | IntrospectionEnumType | IntrospectionInputObjectType;
|
||||
|
||||
export interface IntrospectionScalarType {
|
||||
readonly kind: "SCALAR";
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
}
|
||||
|
||||
export interface IntrospectionObjectType {
|
||||
readonly kind: "OBJECT";
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly fields: ReadonlyArray<IntrospectionField>;
|
||||
readonly interfaces: ReadonlyArray<IntrospectionNamedTypeRef<IntrospectionInterfaceType>>;
|
||||
}
|
||||
|
||||
export interface IntrospectionInterfaceType {
|
||||
readonly kind: "INTERFACE";
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly fields: ReadonlyArray<IntrospectionField>;
|
||||
readonly possibleTypes: ReadonlyArray<IntrospectionNamedTypeRef<IntrospectionObjectType>>;
|
||||
}
|
||||
|
||||
export interface IntrospectionUnionType {
|
||||
readonly kind: "UNION";
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly possibleTypes: ReadonlyArray<IntrospectionNamedTypeRef<IntrospectionObjectType>>;
|
||||
}
|
||||
|
||||
export interface IntrospectionEnumType {
|
||||
readonly kind: "ENUM";
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly enumValues: ReadonlyArray<IntrospectionEnumValue>;
|
||||
}
|
||||
|
||||
export interface IntrospectionInputObjectType {
|
||||
readonly kind: "INPUT_OBJECT";
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly inputFields: ReadonlyArray<IntrospectionInputValue>;
|
||||
}
|
||||
|
||||
export interface IntrospectionListTypeRef<T extends IntrospectionTypeRef = IntrospectionTypeRef> {
|
||||
readonly kind: "LIST";
|
||||
readonly ofType: T;
|
||||
}
|
||||
|
||||
export interface IntrospectionNonNullTypeRef<T extends IntrospectionTypeRef = IntrospectionTypeRef> {
|
||||
readonly kind: "NON_NULL";
|
||||
readonly ofType: T;
|
||||
}
|
||||
|
||||
export type IntrospectionTypeRef =
|
||||
| IntrospectionNamedTypeRef<IntrospectionType>
|
||||
| IntrospectionListTypeRef<any>
|
||||
| IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef<IntrospectionType> | IntrospectionListTypeRef<any>>;
|
||||
|
||||
export type IntrospectionOutputTypeRef =
|
||||
| IntrospectionNamedTypeRef<IntrospectionOutputType>
|
||||
| IntrospectionListTypeRef<any>
|
||||
| IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef<IntrospectionOutputType> | IntrospectionListTypeRef<any>>;
|
||||
|
||||
export type IntrospectionInputTypeRef =
|
||||
| IntrospectionNamedTypeRef<IntrospectionInputType>
|
||||
| IntrospectionListTypeRef<any>
|
||||
| IntrospectionNonNullTypeRef<IntrospectionNamedTypeRef<IntrospectionInputType> | IntrospectionListTypeRef<any>>;
|
||||
|
||||
export interface IntrospectionNamedTypeRef<T extends IntrospectionType = IntrospectionType> {
|
||||
readonly kind: T["kind"];
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
export interface IntrospectionField {
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly args: ReadonlyArray<IntrospectionInputValue>;
|
||||
readonly type: IntrospectionOutputTypeRef;
|
||||
readonly isDeprecated: boolean;
|
||||
readonly deprecationReason?: Maybe<string>;
|
||||
}
|
||||
|
||||
export interface IntrospectionInputValue {
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly type: IntrospectionInputTypeRef;
|
||||
readonly defaultValue?: Maybe<string>;
|
||||
}
|
||||
|
||||
export interface IntrospectionEnumValue {
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly isDeprecated: boolean;
|
||||
readonly deprecationReason?: Maybe<string>;
|
||||
}
|
||||
|
||||
export interface IntrospectionDirective {
|
||||
readonly name: string;
|
||||
readonly description?: Maybe<string>;
|
||||
readonly locations: ReadonlyArray<DirectiveLocationEnum>;
|
||||
readonly args: ReadonlyArray<IntrospectionInputValue>;
|
||||
}
|
||||
8
node_modules/@types/graphql/utilities/isValidJSValue.d.ts
generated
vendored
Normal file
8
node_modules/@types/graphql/utilities/isValidJSValue.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { GraphQLInputType } from "../type/definition";
|
||||
|
||||
/**
|
||||
* Deprecated. Use coerceValue() directly for richer information.
|
||||
*
|
||||
* This function will be removed in v15
|
||||
*/
|
||||
export function isValidJSValue(value: any, type: GraphQLInputType): string[];
|
||||
12
node_modules/@types/graphql/utilities/isValidLiteralValue.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/utilities/isValidLiteralValue.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { GraphQLError } from "../error/GraphQLError";
|
||||
import { ValueNode } from "../language/ast";
|
||||
import { GraphQLInputType } from "../type/definition";
|
||||
|
||||
/**
|
||||
* Utility which determines if a value literal node is valid for an input type.
|
||||
*
|
||||
* Deprecated. Rely on validation for documents containing literal values.
|
||||
*
|
||||
* This function will be removed in v15
|
||||
*/
|
||||
export function isValidLiteralValue(type: GraphQLInputType, valueNode: ValueNode): ReadonlyArray<GraphQLError>;
|
||||
6
node_modules/@types/graphql/utilities/lexicographicSortSchema.d.ts
generated
vendored
Normal file
6
node_modules/@types/graphql/utilities/lexicographicSortSchema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
|
||||
/**
|
||||
* Sort GraphQLSchema.
|
||||
*/
|
||||
export function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema;
|
||||
27
node_modules/@types/graphql/utilities/schemaPrinter.d.ts
generated
vendored
Normal file
27
node_modules/@types/graphql/utilities/schemaPrinter.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { GraphQLType, GraphQLNamedType } from "../type/definition";
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Descriptions are defined as preceding string literals, however an older
|
||||
* experimental version of the SDL supported preceding comments as
|
||||
* descriptions. Set to true to enable this deprecated behavior.
|
||||
* This option is provided to ease adoption and will be removed in v16.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
commentDescriptions?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts options as a second argument:
|
||||
*
|
||||
* - commentDescriptions:
|
||||
* Provide true to use preceding comments as the description.
|
||||
*
|
||||
*/
|
||||
export function printSchema(schema: GraphQLSchema, options?: Options): string;
|
||||
|
||||
export function printIntrospectionSchema(schema: GraphQLSchema, options?: Options): string;
|
||||
|
||||
export function printType(type: GraphQLNamedType, options?: Options): string;
|
||||
9
node_modules/@types/graphql/utilities/separateOperations.d.ts
generated
vendored
Normal file
9
node_modules/@types/graphql/utilities/separateOperations.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { DocumentNode, OperationDefinitionNode } from "../language/ast";
|
||||
|
||||
/**
|
||||
* separateOperations accepts a single AST document which may contain many
|
||||
* operations and fragments and returns a collection of AST documents each of
|
||||
* which contains a single operation as well the fragment definitions it
|
||||
* refers to.
|
||||
*/
|
||||
export function separateOperations(documentAST: DocumentNode): { [key: string]: DocumentNode };
|
||||
28
node_modules/@types/graphql/utilities/typeComparators.d.ts
generated
vendored
Normal file
28
node_modules/@types/graphql/utilities/typeComparators.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { GraphQLType, GraphQLCompositeType, GraphQLAbstractType } from "../type/definition";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
|
||||
/**
|
||||
* Provided two types, return true if the types are equal (invariant).
|
||||
*/
|
||||
export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean;
|
||||
|
||||
/**
|
||||
* Provided a type and a super type, return true if the first type is either
|
||||
* equal or a subset of the second super type (covariant).
|
||||
*/
|
||||
export function isTypeSubTypeOf(schema: GraphQLSchema, maybeSubType: GraphQLType, superType: GraphQLType): boolean;
|
||||
|
||||
/**
|
||||
* Provided two composite types, determine if they "overlap". Two composite
|
||||
* types overlap when the Sets of possible concrete types for each intersect.
|
||||
*
|
||||
* This is often used to determine if a fragment of a given type could possibly
|
||||
* be visited in a context of another type.
|
||||
*
|
||||
* This function is commutative.
|
||||
*/
|
||||
export function doTypesOverlap(
|
||||
schema: GraphQLSchema,
|
||||
typeA: GraphQLCompositeType,
|
||||
typeB: GraphQLCompositeType
|
||||
): boolean;
|
||||
16
node_modules/@types/graphql/utilities/typeFromAST.d.ts
generated
vendored
Normal file
16
node_modules/@types/graphql/utilities/typeFromAST.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode } from "../language/ast";
|
||||
import { GraphQLType, GraphQLNullableType, GraphQLNamedType, GraphQLList, GraphQLNonNull } from "../type/definition";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
|
||||
/**
|
||||
* Given a Schema and an AST node describing a type, return a GraphQLType
|
||||
* definition which applies to that type. For example, if provided the parsed
|
||||
* AST node for `[User]`, a GraphQLList instance will be returned, containing
|
||||
* the type called "User" found in the schema. If a type called "User" is not
|
||||
* found in the schema, then undefined will be returned.
|
||||
*/
|
||||
export function typeFromAST(schema: GraphQLSchema, typeNode: NamedTypeNode): GraphQLNamedType | undefined;
|
||||
|
||||
export function typeFromAST(schema: GraphQLSchema, typeNode: ListTypeNode): GraphQLList<any> | undefined;
|
||||
|
||||
export function typeFromAST(schema: GraphQLSchema, typeNode: NonNullTypeNode): GraphQLNonNull<any> | undefined;
|
||||
29
node_modules/@types/graphql/utilities/valueFromAST.d.ts
generated
vendored
Normal file
29
node_modules/@types/graphql/utilities/valueFromAST.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLInputType } from "../type/definition";
|
||||
import { ValueNode, VariableNode, ListValueNode, ObjectValueNode } from "../language/ast";
|
||||
|
||||
/**
|
||||
* Produces a JavaScript value given a GraphQL Value AST.
|
||||
*
|
||||
* A GraphQL type must be provided, which will be used to interpret different
|
||||
* GraphQL Value literals.
|
||||
*
|
||||
* Returns `undefined` when the value could not be validly coerced according to
|
||||
* the provided type.
|
||||
*
|
||||
* | GraphQL Value | JSON Value |
|
||||
* | -------------------- | ------------- |
|
||||
* | Input Object | Object |
|
||||
* | List | Array |
|
||||
* | Boolean | Boolean |
|
||||
* | String | String |
|
||||
* | Int / Float | Number |
|
||||
* | Enum Value | Mixed |
|
||||
* | NullValue | null |
|
||||
*
|
||||
*/
|
||||
export function valueFromAST(
|
||||
valueNode: Maybe<ValueNode>,
|
||||
type: GraphQLInputType,
|
||||
variables?: Maybe<{ [key: string]: any }>
|
||||
): any;
|
||||
20
node_modules/@types/graphql/utilities/valueFromASTUntyped.d.ts
generated
vendored
Normal file
20
node_modules/@types/graphql/utilities/valueFromASTUntyped.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { ValueNode } from "../language/ast";
|
||||
|
||||
/**
|
||||
* Produces a JavaScript value given a GraphQL Value AST.
|
||||
*
|
||||
* Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value
|
||||
* will reflect the provided GraphQL value AST.
|
||||
*
|
||||
* | GraphQL Value | JavaScript Value |
|
||||
* | -------------------- | ---------------- |
|
||||
* | Input Object | Object |
|
||||
* | List | Array |
|
||||
* | Boolean | Boolean |
|
||||
* | String / Enum | String |
|
||||
* | Int / Float | Number |
|
||||
* | Null | null |
|
||||
*
|
||||
*/
|
||||
export function valueFromASTUntyped(valueNode: ValueNode, variables?: Maybe<{ [key: string]: any }>): any;
|
||||
83
node_modules/@types/graphql/validation/ValidationContext.d.ts
generated
vendored
Normal file
83
node_modules/@types/graphql/validation/ValidationContext.d.ts
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLError } from "../error";
|
||||
import {
|
||||
DocumentNode,
|
||||
OperationDefinitionNode,
|
||||
VariableNode,
|
||||
SelectionSetNode,
|
||||
FragmentSpreadNode,
|
||||
FragmentDefinitionNode,
|
||||
} from "../language/ast";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import {
|
||||
GraphQLInputType,
|
||||
GraphQLOutputType,
|
||||
GraphQLCompositeType,
|
||||
GraphQLField,
|
||||
GraphQLArgument,
|
||||
} from "../type/definition";
|
||||
import { GraphQLDirective } from "../type/directives";
|
||||
import { TypeInfo } from "../utilities/TypeInfo";
|
||||
import { ASTVisitor } from "../language/visitor";
|
||||
|
||||
type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode;
|
||||
type VariableUsage = {
|
||||
readonly node: VariableNode;
|
||||
readonly type: Maybe<GraphQLInputType>;
|
||||
readonly defaultValue: Maybe<any>;
|
||||
};
|
||||
|
||||
/**
|
||||
* An instance of this class is passed as the "this" context to all validators,
|
||||
* allowing access to commonly useful contextual information from within a
|
||||
* validation rule.
|
||||
*/
|
||||
export class ASTValidationContext {
|
||||
constructor(ast: DocumentNode);
|
||||
|
||||
reportError(error: GraphQLError): undefined;
|
||||
|
||||
getErrors(): ReadonlyArray<GraphQLError>;
|
||||
|
||||
getDocument(): DocumentNode;
|
||||
}
|
||||
|
||||
export class SDLValidationContext extends ASTValidationContext {
|
||||
constructor(ast: DocumentNode, schema?: Maybe<GraphQLSchema>);
|
||||
|
||||
getSchema(): Maybe<GraphQLSchema>;
|
||||
}
|
||||
|
||||
export type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor;
|
||||
|
||||
export class ValidationContext extends ASTValidationContext {
|
||||
constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo);
|
||||
|
||||
getSchema(): GraphQLSchema;
|
||||
|
||||
getFragment(name: string): Maybe<FragmentDefinitionNode>;
|
||||
|
||||
getFragmentSpreads(node: SelectionSetNode): ReadonlyArray<FragmentSpreadNode>;
|
||||
|
||||
getRecursivelyReferencedFragments(operation: OperationDefinitionNode): ReadonlyArray<FragmentDefinitionNode>;
|
||||
|
||||
getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray<VariableUsage>;
|
||||
|
||||
getRecursiveVariableUsages(operation: OperationDefinitionNode): ReadonlyArray<VariableUsage>;
|
||||
|
||||
getType(): Maybe<GraphQLOutputType>;
|
||||
|
||||
getParentType(): Maybe<GraphQLCompositeType>;
|
||||
|
||||
getInputType(): Maybe<GraphQLInputType>;
|
||||
|
||||
getParentInputType(): Maybe<GraphQLInputType>;
|
||||
|
||||
getFieldDef(): Maybe<GraphQLField<any, any>>;
|
||||
|
||||
getDirective(): Maybe<GraphQLDirective>;
|
||||
|
||||
getArgument(): Maybe<GraphQLArgument>;
|
||||
}
|
||||
|
||||
export type ValidationRule = (context: ValidationContext) => ASTVisitor;
|
||||
80
node_modules/@types/graphql/validation/index.d.ts
generated
vendored
Normal file
80
node_modules/@types/graphql/validation/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
export { validate } from "./validate";
|
||||
|
||||
export { ValidationContext } from "./ValidationContext";
|
||||
|
||||
export { specifiedRules } from "./specifiedRules";
|
||||
|
||||
// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"
|
||||
export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectType";
|
||||
|
||||
// Spec Section: "Fragments on Composite Types"
|
||||
export { FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypes";
|
||||
|
||||
// Spec Section: "Argument Names"
|
||||
export { KnownArgumentNames as KnownArgumentNamesRule } from "./rules/KnownArgumentNames";
|
||||
|
||||
// Spec Section: "Directives Are Defined"
|
||||
export { KnownDirectives as KnownDirectivesRule } from "./rules/KnownDirectives";
|
||||
|
||||
// Spec Section: "Fragment spread target defined"
|
||||
export { KnownFragmentNames as KnownFragmentNamesRule } from "./rules/KnownFragmentNames";
|
||||
|
||||
// Spec Section: "Fragment Spread Type Existence"
|
||||
export { KnownTypeNames as KnownTypeNamesRule } from "./rules/KnownTypeNames";
|
||||
|
||||
// Spec Section: "Lone Anonymous Operation"
|
||||
export { LoneAnonymousOperation as LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperation";
|
||||
|
||||
// Spec Section: "Fragments must not form cycles"
|
||||
export { NoFragmentCycles as NoFragmentCyclesRule } from "./rules/NoFragmentCycles";
|
||||
|
||||
// Spec Section: "All Variable Used Defined"
|
||||
export { NoUndefinedVariables as NoUndefinedVariablesRule } from "./rules/NoUndefinedVariables";
|
||||
|
||||
// Spec Section: "Fragments must be used"
|
||||
export { NoUnusedFragments as NoUnusedFragmentsRule } from "./rules/NoUnusedFragments";
|
||||
|
||||
// Spec Section: "All Variables Used"
|
||||
export { NoUnusedVariables as NoUnusedVariablesRule } from "./rules/NoUnusedVariables";
|
||||
|
||||
// Spec Section: "Field Selection Merging"
|
||||
export { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMerged";
|
||||
|
||||
// Spec Section: "Fragment spread is possible"
|
||||
export { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreads";
|
||||
|
||||
// Spec Section: "Argument Optionality"
|
||||
export { ProvidedRequiredArguments as ProvidedRequiredArgumentsRule } from "./rules/ProvidedRequiredArguments";
|
||||
|
||||
// Spec Section: "Leaf Field Selections"
|
||||
export { ScalarLeafs as ScalarLeafsRule } from "./rules/ScalarLeafs";
|
||||
|
||||
// Spec Section: "Subscriptions with Single Root Field"
|
||||
export { SingleFieldSubscriptions as SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptions";
|
||||
|
||||
// Spec Section: "Argument Uniqueness"
|
||||
export { UniqueArgumentNames as UniqueArgumentNamesRule } from "./rules/UniqueArgumentNames";
|
||||
|
||||
// Spec Section: "Directives Are Unique Per Location"
|
||||
export { UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocation";
|
||||
|
||||
// Spec Section: "Fragment Name Uniqueness"
|
||||
export { UniqueFragmentNames as UniqueFragmentNamesRule } from "./rules/UniqueFragmentNames";
|
||||
|
||||
// Spec Section: "Input Object Field Uniqueness"
|
||||
export { UniqueInputFieldNames as UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNames";
|
||||
|
||||
// Spec Section: "Operation Name Uniqueness"
|
||||
export { UniqueOperationNames as UniqueOperationNamesRule } from "./rules/UniqueOperationNames";
|
||||
|
||||
// Spec Section: "Variable Uniqueness"
|
||||
export { UniqueVariableNames as UniqueVariableNamesRule } from "./rules/UniqueVariableNames";
|
||||
|
||||
// Spec Section: "Values Type Correctness"
|
||||
export { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectType";
|
||||
|
||||
// Spec Section: "Variables are Input Types"
|
||||
export { VariablesAreInputTypes as VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypes";
|
||||
|
||||
// Spec Section: "All Variable Usages Are Allowed"
|
||||
export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPosition";
|
||||
12
node_modules/@types/graphql/validation/rules/ExecutableDefinitions.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/ExecutableDefinitions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function nonExecutableDefinitionMessage(defName: string): string;
|
||||
|
||||
/**
|
||||
* Executable definitions
|
||||
*
|
||||
* A GraphQL document is only valid for execution if all definitions are either
|
||||
* operation or fragment definitions.
|
||||
*/
|
||||
export function ExecutableDefinitions(context: ASTValidationContext): ASTVisitor;
|
||||
10
node_modules/@types/graphql/validation/rules/FieldsOnCorrectType.d.ts
generated
vendored
Normal file
10
node_modules/@types/graphql/validation/rules/FieldsOnCorrectType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
/**
|
||||
* Fields on correct type
|
||||
*
|
||||
* A GraphQL document is only valid if all fields selected are defined by the
|
||||
* parent type, or are an allowed meta field such as __typename.
|
||||
*/
|
||||
export function FieldsOnCorrectType(context: ValidationContext): ASTVisitor;
|
||||
15
node_modules/@types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts
generated
vendored
Normal file
15
node_modules/@types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function inlineFragmentOnNonCompositeErrorMessage(type: string): string;
|
||||
|
||||
export function fragmentOnNonCompositeErrorMessage(fragName: string, type: string): string;
|
||||
|
||||
/**
|
||||
* Fragments on composite type
|
||||
*
|
||||
* Fragments use a type condition to determine if they apply, since fragments
|
||||
* can only be spread into a composite type (object, interface, or union), the
|
||||
* type condition must also be a composite type.
|
||||
*/
|
||||
export function FragmentsOnCompositeTypes(context: ValidationContext): ASTVisitor;
|
||||
26
node_modules/@types/graphql/validation/rules/KnownArgumentNames.d.ts
generated
vendored
Normal file
26
node_modules/@types/graphql/validation/rules/KnownArgumentNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { ValidationContext, SDLValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unknownArgMessage(
|
||||
argName: string,
|
||||
fieldName: string,
|
||||
typeName: string,
|
||||
suggestedArgs: Array<string>
|
||||
): string;
|
||||
|
||||
export function unknownDirectiveArgMessage(
|
||||
argName: string,
|
||||
directiveName: string,
|
||||
suggestedArgs: Array<string>
|
||||
): string;
|
||||
|
||||
/**
|
||||
* Known argument names
|
||||
*
|
||||
* A GraphQL field is only valid if all supplied arguments are defined by
|
||||
* that field.
|
||||
*/
|
||||
export function KnownArgumentNames(context: ValidationContext): ASTVisitor;
|
||||
|
||||
// @internal
|
||||
export function KnownArgumentNamesOnDirectives(context: ValidationContext | SDLValidationContext): ASTVisitor;
|
||||
14
node_modules/@types/graphql/validation/rules/KnownDirectives.d.ts
generated
vendored
Normal file
14
node_modules/@types/graphql/validation/rules/KnownDirectives.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ValidationContext, SDLValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unknownDirectiveMessage(directiveName: string): string;
|
||||
|
||||
export function misplacedDirectiveMessage(directiveName: string, location: string): string;
|
||||
|
||||
/**
|
||||
* Known directives
|
||||
*
|
||||
* A GraphQL document is only valid if all `@directives` are known by the
|
||||
* schema and legally positioned.
|
||||
*/
|
||||
export function KnownDirectives(context: ValidationContext | SDLValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/KnownFragmentNames.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/KnownFragmentNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unknownFragmentMessage(fragName: string): string;
|
||||
|
||||
/**
|
||||
* Known fragment names
|
||||
*
|
||||
* A GraphQL document is only valid if all `...Fragment` fragment spreads refer
|
||||
* to fragments defined in the same document.
|
||||
*/
|
||||
export function KnownFragmentNames(context: ValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/KnownTypeNames.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/KnownTypeNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unknownTypeMessage(typeName: string, suggestedTypes: Array<string>): string;
|
||||
|
||||
/**
|
||||
* Known type names
|
||||
*
|
||||
* A GraphQL document is only valid if referenced types (specifically
|
||||
* variable definitions and fragment conditions) are defined by the type schema.
|
||||
*/
|
||||
export function KnownTypeNames(context: ValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/LoneAnonymousOperation.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/LoneAnonymousOperation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function anonOperationNotAloneMessage(): string;
|
||||
|
||||
/**
|
||||
* Lone anonymous operation
|
||||
*
|
||||
* A GraphQL document is only valid if when it contains an anonymous operation
|
||||
* (the query short-hand) that it contains only that one operation definition.
|
||||
*/
|
||||
export function LoneAnonymousOperation(context: ASTValidationContext): ASTVisitor;
|
||||
13
node_modules/@types/graphql/validation/rules/LoneSchemaDefinition.d.ts
generated
vendored
Normal file
13
node_modules/@types/graphql/validation/rules/LoneSchemaDefinition.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { SDLValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function schemaDefinitionNotAloneMessage(): string;
|
||||
|
||||
export function canNotDefineSchemaWithinExtensionMessage(): string;
|
||||
|
||||
/**
|
||||
* Lone Schema definition
|
||||
*
|
||||
* A GraphQL document is only valid if it contains only one schema definition.
|
||||
*/
|
||||
export function LoneSchemaDefinition(context: SDLValidationContext): ASTVisitor;
|
||||
6
node_modules/@types/graphql/validation/rules/NoFragmentCycles.d.ts
generated
vendored
Normal file
6
node_modules/@types/graphql/validation/rules/NoFragmentCycles.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function cycleErrorMessage(fragName: string, spreadNames: Array<string>): string;
|
||||
|
||||
export function NoFragmentCycles(context: ValidationContext): ASTVisitor;
|
||||
13
node_modules/@types/graphql/validation/rules/NoUndefinedVariables.d.ts
generated
vendored
Normal file
13
node_modules/@types/graphql/validation/rules/NoUndefinedVariables.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import Maybe from "../../tsutils/Maybe";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function undefinedVarMessage(varName: string, opName: Maybe<string>): string;
|
||||
|
||||
/**
|
||||
* No undefined variables
|
||||
*
|
||||
* A GraphQL operation is only valid if all variables encountered, both directly
|
||||
* and via fragment spreads, are defined by that operation.
|
||||
*/
|
||||
export function NoUndefinedVariables(context: ValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/NoUnusedFragments.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/NoUnusedFragments.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unusedFragMessage(fragName: string): string;
|
||||
|
||||
/**
|
||||
* No unused fragments
|
||||
*
|
||||
* A GraphQL document is only valid if all fragment definitions are spread
|
||||
* within operations, or spread within other fragments spread within operations.
|
||||
*/
|
||||
export function NoUnusedFragments(context: ValidationContext): ASTVisitor;
|
||||
13
node_modules/@types/graphql/validation/rules/NoUnusedVariables.d.ts
generated
vendored
Normal file
13
node_modules/@types/graphql/validation/rules/NoUnusedVariables.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import Maybe from "../../tsutils/Maybe";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unusedVariableMessage(varName: string, opName: Maybe<string>): string;
|
||||
|
||||
/**
|
||||
* No unused variables
|
||||
*
|
||||
* A GraphQL operation is only valid if all variables defined by an operation
|
||||
* are used, either directly or within a spread fragment.
|
||||
*/
|
||||
export function NoUnusedVariables(context: ValidationContext): ASTVisitor;
|
||||
19
node_modules/@types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts
generated
vendored
Normal file
19
node_modules/@types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function fieldsConflictMessage(responseName: string, reason: ConflictReasonMessage): string;
|
||||
|
||||
/**
|
||||
* Overlapping fields can be merged
|
||||
*
|
||||
* A selection set is only valid if all fields (including spreading any
|
||||
* fragments) either correspond to distinct response names or can be merged
|
||||
* without ambiguity.
|
||||
*/
|
||||
export function OverlappingFieldsCanBeMerged(context: ValidationContext): ASTVisitor;
|
||||
|
||||
// Field name and reason.
|
||||
type ConflictReason = [string, string];
|
||||
|
||||
// Reason is a string, or a nested list of conflicts.
|
||||
type ConflictReasonMessage = string | Array<ConflictReason>;
|
||||
15
node_modules/@types/graphql/validation/rules/PossibleFragmentSpreads.d.ts
generated
vendored
Normal file
15
node_modules/@types/graphql/validation/rules/PossibleFragmentSpreads.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function typeIncompatibleSpreadMessage(fragName: string, parentType: string, fragType: string): string;
|
||||
|
||||
export function typeIncompatibleAnonSpreadMessage(parentType: string, fragType: string): string;
|
||||
|
||||
/**
|
||||
* Possible fragment spread
|
||||
*
|
||||
* A fragment spread is only valid if the type condition could ever possibly
|
||||
* be true: if there is a non-empty intersection of the possible parent types,
|
||||
* and possible types which pass the type condition.
|
||||
*/
|
||||
export function PossibleFragmentSpreads(context: ValidationContext): ASTVisitor;
|
||||
17
node_modules/@types/graphql/validation/rules/ProvidedRequiredArguments.d.ts
generated
vendored
Normal file
17
node_modules/@types/graphql/validation/rules/ProvidedRequiredArguments.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ValidationContext, SDLValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function missingFieldArgMessage(fieldName: string, argName: string, type: string): string;
|
||||
|
||||
export function missingDirectiveArgMessage(directiveName: string, argName: string, type: string): string;
|
||||
|
||||
/**
|
||||
* Provided required arguments
|
||||
*
|
||||
* A field or directive is only valid if all required (non-null without a
|
||||
* default value) field arguments have been provided.
|
||||
*/
|
||||
export function ProvidedRequiredArguments(context: ValidationContext): ASTVisitor;
|
||||
|
||||
// @internal
|
||||
export function ProvidedRequiredArgumentsOnDirectives(context: ValidationContext | SDLValidationContext): ASTVisitor;
|
||||
14
node_modules/@types/graphql/validation/rules/ScalarLeafs.d.ts
generated
vendored
Normal file
14
node_modules/@types/graphql/validation/rules/ScalarLeafs.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function noSubselectionAllowedMessage(fieldName: string, type: string): string;
|
||||
|
||||
export function requiredSubselectionMessage(fieldName: string, type: string): string;
|
||||
|
||||
/**
|
||||
* Scalar leafs
|
||||
*
|
||||
* A GraphQL document is valid only if all leaf fields (fields without
|
||||
* sub selections) are of scalar or enum types.
|
||||
*/
|
||||
export function ScalarLeafs(context: ValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/SingleFieldSubscriptions.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/SingleFieldSubscriptions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import Maybe from "../../tsutils/Maybe";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function singleFieldOnlyMessage(name: Maybe<string>): string;
|
||||
|
||||
/**
|
||||
* Subscriptions must only include one field.
|
||||
*
|
||||
* A GraphQL subscription is valid only if it contains a single root field.
|
||||
*/
|
||||
export function SingleFieldSubscriptions(context: ASTValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/UniqueArgumentNames.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/UniqueArgumentNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateArgMessage(argName: string): string;
|
||||
|
||||
/**
|
||||
* Unique argument names
|
||||
*
|
||||
* A GraphQL field or directive is only valid if all supplied arguments are
|
||||
* uniquely named.
|
||||
*/
|
||||
export function UniqueArgumentNames(context: ASTValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateDirectiveMessage(directiveName: string): string;
|
||||
|
||||
/**
|
||||
* Unique directive names per location
|
||||
*
|
||||
* A GraphQL document is only valid if all directives at a given location
|
||||
* are uniquely named.
|
||||
*/
|
||||
export function UniqueDirectivesPerLocation(context: ASTValidationContext): ASTVisitor;
|
||||
11
node_modules/@types/graphql/validation/rules/UniqueFragmentNames.d.ts
generated
vendored
Normal file
11
node_modules/@types/graphql/validation/rules/UniqueFragmentNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateFragmentNameMessage(fragName: string): string;
|
||||
|
||||
/**
|
||||
* Unique fragment names
|
||||
*
|
||||
* A GraphQL document is only valid if all defined fragments have unique names.
|
||||
*/
|
||||
export function UniqueFragmentNames(context: ASTValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/UniqueInputFieldNames.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/UniqueInputFieldNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateInputFieldMessage(fieldName: string): string;
|
||||
|
||||
/**
|
||||
* Unique input field names
|
||||
*
|
||||
* A GraphQL input object value is only valid if all supplied fields are
|
||||
* uniquely named.
|
||||
*/
|
||||
export function UniqueInputFieldNames(context: ASTValidationContext): ASTVisitor;
|
||||
11
node_modules/@types/graphql/validation/rules/UniqueOperationNames.d.ts
generated
vendored
Normal file
11
node_modules/@types/graphql/validation/rules/UniqueOperationNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateOperationNameMessage(operationName: string): string;
|
||||
|
||||
/**
|
||||
* Unique operation names
|
||||
*
|
||||
* A GraphQL document is only valid if all defined operations have unique names.
|
||||
*/
|
||||
export function UniqueOperationNames(context: ASTValidationContext): ASTVisitor;
|
||||
11
node_modules/@types/graphql/validation/rules/UniqueVariableNames.d.ts
generated
vendored
Normal file
11
node_modules/@types/graphql/validation/rules/UniqueVariableNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateVariableMessage(variableName: string): string;
|
||||
|
||||
/**
|
||||
* Unique variable names
|
||||
*
|
||||
* A GraphQL operation is only valid if all its variables are uniquely named.
|
||||
*/
|
||||
export function UniqueVariableNames(context: ASTValidationContext): ASTVisitor;
|
||||
16
node_modules/@types/graphql/validation/rules/ValuesOfCorrectType.d.ts
generated
vendored
Normal file
16
node_modules/@types/graphql/validation/rules/ValuesOfCorrectType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function badValueMessage(typeName: string, valueName: string, message?: string): string;
|
||||
|
||||
export function requiredFieldMessage(typeName: string, fieldName: string, fieldTypeName: string): string;
|
||||
|
||||
export function unknownFieldMessage(typeName: string, fieldName: string, message?: string): string;
|
||||
|
||||
/**
|
||||
* Value literals of correct type
|
||||
*
|
||||
* A GraphQL document is only valid if all value literals are of the type
|
||||
* expected at their position.
|
||||
*/
|
||||
export function ValuesOfCorrectType(context: ValidationContext): ASTVisitor;
|
||||
12
node_modules/@types/graphql/validation/rules/VariablesAreInputTypes.d.ts
generated
vendored
Normal file
12
node_modules/@types/graphql/validation/rules/VariablesAreInputTypes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function nonInputTypeOnVarMessage(variableName: string, typeName: string): string;
|
||||
|
||||
/**
|
||||
* Variables are input types
|
||||
*
|
||||
* A GraphQL operation is only valid if all the variables it defines are of
|
||||
* input types (scalar, enum, or input object).
|
||||
*/
|
||||
export function VariablesAreInputTypes(context: ValidationContext): ASTVisitor;
|
||||
9
node_modules/@types/graphql/validation/rules/VariablesInAllowedPosition.d.ts
generated
vendored
Normal file
9
node_modules/@types/graphql/validation/rules/VariablesInAllowedPosition.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function badVarPosMessage(varName: string, varType: string, expectedType: string): string;
|
||||
|
||||
/**
|
||||
* Variables passed to field arguments conform to type
|
||||
*/
|
||||
export function VariablesInAllowedPosition(context: ValidationContext): ASTVisitor;
|
||||
92
node_modules/@types/graphql/validation/specifiedRules.d.ts
generated
vendored
Normal file
92
node_modules/@types/graphql/validation/specifiedRules.d.ts
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
import { ValidationRule, SDLValidationRule } from "./ValidationContext";
|
||||
|
||||
// Spec Section: "Executable Definitions"
|
||||
import { ExecutableDefinitions } from "./rules/ExecutableDefinitions";
|
||||
|
||||
// Spec Section: "Operation Name Uniqueness"
|
||||
import { UniqueOperationNames } from "./rules/UniqueOperationNames";
|
||||
|
||||
// Spec Section: "Lone Anonymous Operation"
|
||||
import { LoneAnonymousOperation } from "./rules/LoneAnonymousOperation";
|
||||
|
||||
// Spec Section: "Subscriptions with Single Root Field"
|
||||
import { SingleFieldSubscriptions } from "./rules/SingleFieldSubscriptions";
|
||||
|
||||
// Spec Section: "Fragment Spread Type Existence"
|
||||
import { KnownTypeNames } from "./rules/KnownTypeNames";
|
||||
|
||||
// Spec Section: "Fragments on Composite Types"
|
||||
import { FragmentsOnCompositeTypes } from "./rules/FragmentsOnCompositeTypes";
|
||||
|
||||
// Spec Section: "Variables are Input Types"
|
||||
import { VariablesAreInputTypes } from "./rules/VariablesAreInputTypes";
|
||||
|
||||
// Spec Section: "Leaf Field Selections"
|
||||
import { ScalarLeafs } from "./rules/ScalarLeafs";
|
||||
|
||||
// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"
|
||||
import { FieldsOnCorrectType } from "./rules/FieldsOnCorrectType";
|
||||
|
||||
// Spec Section: "Fragment Name Uniqueness"
|
||||
import { UniqueFragmentNames } from "./rules/UniqueFragmentNames";
|
||||
|
||||
// Spec Section: "Fragment spread target defined"
|
||||
import { KnownFragmentNames } from "./rules/KnownFragmentNames";
|
||||
|
||||
// Spec Section: "Fragments must be used"
|
||||
import { NoUnusedFragments } from "./rules/NoUnusedFragments";
|
||||
|
||||
// Spec Section: "Fragment spread is possible"
|
||||
import { PossibleFragmentSpreads } from "./rules/PossibleFragmentSpreads";
|
||||
|
||||
// Spec Section: "Fragments must not form cycles"
|
||||
import { NoFragmentCycles } from "./rules/NoFragmentCycles";
|
||||
|
||||
// Spec Section: "Variable Uniqueness"
|
||||
import { UniqueVariableNames } from "./rules/UniqueVariableNames";
|
||||
|
||||
// Spec Section: "All Variable Used Defined"
|
||||
import { NoUndefinedVariables } from "./rules/NoUndefinedVariables";
|
||||
|
||||
// Spec Section: "All Variables Used"
|
||||
import { NoUnusedVariables } from "./rules/NoUnusedVariables";
|
||||
|
||||
// Spec Section: "Directives Are Defined"
|
||||
import { KnownDirectives } from "./rules/KnownDirectives";
|
||||
|
||||
// Spec Section: "Directives Are Unique Per Location"
|
||||
import { UniqueDirectivesPerLocation } from "./rules/UniqueDirectivesPerLocation";
|
||||
|
||||
// Spec Section: "Argument Names"
|
||||
import { KnownArgumentNames } from "./rules/KnownArgumentNames";
|
||||
|
||||
// Spec Section: "Argument Uniqueness"
|
||||
import { UniqueArgumentNames } from "./rules/UniqueArgumentNames";
|
||||
|
||||
// Spec Section: "Value Type Correctness"
|
||||
import { ValuesOfCorrectType } from "./rules/ValuesOfCorrectType";
|
||||
|
||||
// Spec Section: "Argument Optionality"
|
||||
import { ProvidedRequiredArguments } from "./rules/ProvidedRequiredArguments";
|
||||
|
||||
// Spec Section: "All Variable Usages Are Allowed"
|
||||
import { VariablesInAllowedPosition } from "./rules/VariablesInAllowedPosition";
|
||||
|
||||
// Spec Section: "Field Selection Merging"
|
||||
import { OverlappingFieldsCanBeMerged } from "./rules/OverlappingFieldsCanBeMerged";
|
||||
|
||||
// Spec Section: "Input Object Field Uniqueness"
|
||||
import { UniqueInputFieldNames } from "./rules/UniqueInputFieldNames";
|
||||
|
||||
/**
|
||||
* This set includes all validation rules defined by the GraphQL spec.
|
||||
*
|
||||
* The order of the rules in this list has been adjusted to lead to the
|
||||
* most clear output when encountering multiple validation errors.
|
||||
*/
|
||||
export const specifiedRules: ReadonlyArray<ValidationRule>;
|
||||
|
||||
import { LoneSchemaDefinition } from "./rules/LoneSchemaDefinition";
|
||||
|
||||
// @internal
|
||||
export const specifiedSDLRules: ReadonlyArray<SDLValidationRule>;
|
||||
51
node_modules/@types/graphql/validation/validate.d.ts
generated
vendored
Normal file
51
node_modules/@types/graphql/validation/validate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import { GraphQLError } from "../error";
|
||||
import { DocumentNode } from "../language/ast";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { TypeInfo } from "../utilities/TypeInfo";
|
||||
import { ValidationRule, SDLValidationRule } from "./ValidationContext";
|
||||
|
||||
/**
|
||||
* Implements the "Validation" section of the spec.
|
||||
*
|
||||
* Validation runs synchronously, returning an array of encountered errors, or
|
||||
* an empty array if no errors were encountered and the document is valid.
|
||||
*
|
||||
* A list of specific validation rules may be provided. If not provided, the
|
||||
* default list of rules defined by the GraphQL specification will be used.
|
||||
*
|
||||
* Each validation rules is a function which returns a visitor
|
||||
* (see the language/visitor API). Visitor methods are expected to return
|
||||
* GraphQLErrors, or Arrays of GraphQLErrors when invalid.
|
||||
*
|
||||
* Optionally a custom TypeInfo instance may be provided. If not provided, one
|
||||
* will be created from the provided schema.
|
||||
*/
|
||||
export function validate(
|
||||
schema: GraphQLSchema,
|
||||
documentAST: DocumentNode,
|
||||
rules?: ReadonlyArray<ValidationRule>,
|
||||
typeInfo?: TypeInfo
|
||||
): ReadonlyArray<GraphQLError>;
|
||||
|
||||
// @internal
|
||||
export function validateSDL(
|
||||
documentAST: DocumentNode,
|
||||
schemaToExtend?: GraphQLSchema | null,
|
||||
rules?: ReadonlyArray<SDLValidationRule>
|
||||
): GraphQLError[];
|
||||
|
||||
/**
|
||||
* Utility function which asserts a SDL document is valid by throwing an error
|
||||
* if it is invalid.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export function assertValidSDL(documentAST: DocumentNode): undefined;
|
||||
|
||||
/**
|
||||
* Utility function which asserts a SDL document is valid by throwing an error
|
||||
* if it is invalid.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export function assertValidSDLExtension(documentAST: DocumentNode, schema: GraphQLSchema): undefined;
|
||||
21
node_modules/graphql/LICENSE
generated
vendored
Normal file
21
node_modules/graphql/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) GraphQL Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1
node_modules/graphql/NotSupportedTSVersion.d.ts
generated
vendored
Normal file
1
node_modules/graphql/NotSupportedTSVersion.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"Package 'graphql' support only TS versions that are >=4.1.0".
|
||||
203
node_modules/graphql/README.md
generated
vendored
Normal file
203
node_modules/graphql/README.md
generated
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
[](https://graphql.org/conf/2025/?utm_source=github&utm_medium=graphql_js&utm_campaign=readme)
|
||||
|
||||
# GraphQL.js
|
||||
|
||||
The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook.
|
||||
|
||||
[](https://badge.fury.io/js/graphql)
|
||||
[](https://github.com/graphql/graphql-js/actions?query=branch%3Amain)
|
||||
[](https://codecov.io/gh/graphql/graphql-js)
|
||||
|
||||
See more complete documentation at https://graphql.org/ and
|
||||
https://graphql.org/graphql-js/.
|
||||
|
||||
Looking for help? Find resources [from the community](https://graphql.org/community/).
|
||||
|
||||
## Getting Started
|
||||
|
||||
A general overview of GraphQL is available in the
|
||||
[README](https://github.com/graphql/graphql-spec/blob/main/README.md) for the
|
||||
[Specification for GraphQL](https://github.com/graphql/graphql-spec). That overview
|
||||
describes a simple set of GraphQL examples that exist as [tests](src/__tests__)
|
||||
in this repository. A good way to get started with this repository is to walk
|
||||
through that README and the corresponding tests in parallel.
|
||||
|
||||
### Using GraphQL.js
|
||||
|
||||
Install GraphQL.js from npm
|
||||
|
||||
With npm:
|
||||
|
||||
```sh
|
||||
npm install --save graphql
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add graphql
|
||||
```
|
||||
|
||||
GraphQL.js provides two important capabilities: building a type schema and
|
||||
serving queries against that type schema.
|
||||
|
||||
First, build a GraphQL type schema which maps to your codebase.
|
||||
|
||||
```js
|
||||
import {
|
||||
graphql,
|
||||
GraphQLSchema,
|
||||
GraphQLObjectType,
|
||||
GraphQLString,
|
||||
} from 'graphql';
|
||||
|
||||
var schema = new GraphQLSchema({
|
||||
query: new GraphQLObjectType({
|
||||
name: 'RootQueryType',
|
||||
fields: {
|
||||
hello: {
|
||||
type: GraphQLString,
|
||||
resolve() {
|
||||
return 'world';
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
});
|
||||
```
|
||||
|
||||
This defines a simple schema, with one type and one field, that resolves
|
||||
to a fixed value. The `resolve` function can return a value, a promise,
|
||||
or an array of promises. A more complex example is included in the top-level [tests](src/__tests__) directory.
|
||||
|
||||
Then, serve the result of a query against that type schema.
|
||||
|
||||
```js
|
||||
var source = '{ hello }';
|
||||
|
||||
graphql({ schema, source }).then((result) => {
|
||||
// Prints
|
||||
// {
|
||||
// data: { hello: "world" }
|
||||
// }
|
||||
console.log(result);
|
||||
});
|
||||
```
|
||||
|
||||
This runs a query fetching the one field defined. The `graphql` function will
|
||||
first ensure the query is syntactically and semantically valid before executing
|
||||
it, reporting errors otherwise.
|
||||
|
||||
```js
|
||||
var source = '{ BoyHowdy }';
|
||||
|
||||
graphql({ schema, source }).then((result) => {
|
||||
// Prints
|
||||
// {
|
||||
// errors: [
|
||||
// { message: 'Cannot query field BoyHowdy on RootQueryType',
|
||||
// locations: [ { line: 1, column: 3 } ] }
|
||||
// ]
|
||||
// }
|
||||
console.log(result);
|
||||
});
|
||||
```
|
||||
|
||||
**Note**: Please don't forget to set `NODE_ENV=production` if you are running a production server. It will disable some checks that can be useful during development but will significantly impact performance.
|
||||
|
||||
## Want to ride the bleeding edge?
|
||||
|
||||
The `npm` branch in this repository is automatically maintained to be the last
|
||||
commit to `main` to pass all tests, in the same form found on npm. It is
|
||||
recommended to use builds deployed to npm for many reasons, but if you want to use
|
||||
the latest not-yet-released version of graphql-js, you can do so by depending
|
||||
directly on this branch:
|
||||
|
||||
```
|
||||
npm install graphql@git://github.com/graphql/graphql-js.git#npm
|
||||
```
|
||||
|
||||
### 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
|
||||
|
||||
GraphQL.js is a general-purpose library and can be used both in a Node server
|
||||
and in the browser. As an example, the [GraphiQL](https://github.com/graphql/graphiql/)
|
||||
tool is built with GraphQL.js!
|
||||
|
||||
Building a project using GraphQL.js with [webpack](https://webpack.js.org) or
|
||||
[rollup](https://github.com/rollup/rollup) should just work and only include
|
||||
the portions of the library you use. This works because GraphQL.js is distributed
|
||||
with both CommonJS (`require()`) and ESModule (`import`) files. Ensure that any
|
||||
custom build configurations look for `.mjs` files!
|
||||
|
||||
## Contributing
|
||||
|
||||
We actively welcome pull requests. Learn how to [contribute](./.github/CONTRIBUTING.md).
|
||||
|
||||
This repository is managed by EasyCLA. Project participants must sign the free ([GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/).
|
||||
|
||||
To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you.
|
||||
|
||||
You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [operations@graphql.org](mailto:operations@graphql.org).
|
||||
|
||||
If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the [GraphQL Foundation](https://foundation.graphql.org/join).
|
||||
|
||||
## Changelog
|
||||
|
||||
Changes are tracked as [GitHub releases](https://github.com/graphql/graphql-js/releases).
|
||||
|
||||
## License
|
||||
|
||||
GraphQL.js is [MIT-licensed](./LICENSE).
|
||||
|
||||
## Version Support
|
||||
|
||||
GraphQL.JS follows Semantic Versioning (SemVer) for its releases. Our version support policy is as follows:
|
||||
|
||||
- Latest Major Version: We provide full support, including bug fixes and security updates, for the latest major version of GraphQL.JS.
|
||||
- Previous Major Version: We offer feature support for the previous major version for 12 months after the release of the newest major version.
|
||||
This means that for 12 months we can backport features for specification changes _if_ they don't cause any breaking changes. We'll continue
|
||||
supporting the previous major version with bug and security fixes.
|
||||
- Older Versions: Versions older than the previous major release are considered unsupported. While the code remains available,
|
||||
we do not actively maintain or provide updates for these versions.
|
||||
One exception to this rule is when the older version has been released < 1 year ago, in that case we
|
||||
will treat it like the "Previous Major Version".
|
||||
|
||||
### Long-Term Support (LTS)
|
||||
|
||||
We do not currently offer a Long-Term Support version of GraphQL.JS. Users are encouraged to upgrade to the latest stable version
|
||||
to receive the most up-to-date features, performance improvements, and security updates.
|
||||
|
||||
### End-of-Life (EOL) Schedule
|
||||
|
||||
We will announce the EOL date for a major version at least 6 months in advance.
|
||||
After a version reaches its EOL, it will no longer receive updates, even for critical security issues.
|
||||
|
||||
### Upgrade Assistance
|
||||
|
||||
To assist users in upgrading to newer versions:
|
||||
|
||||
- We maintain detailed release notes for each version, highlighting new features, breaking changes, and deprecations.
|
||||
- [Our documentation](https://www.graphql-js.org/) includes migration guides for moving between major versions.
|
||||
- The [community forum (Discord channel #graphql-js)](https://discord.graphql.org) is available for users who need additional assistance with upgrades.
|
||||
|
||||
### Security Updates
|
||||
|
||||
We prioritize the security of GraphQL.JS:
|
||||
|
||||
- Critical security updates will be applied to both the current and previous major version.
|
||||
- For versions that have reached EOL, we strongly recommend upgrading to a supported version to receive security updates.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
We welcome community contributions for all versions of GraphQL.JS. However, our maintainers will primarily focus on reviewing
|
||||
and merging contributions for supported versions.
|
||||
152
node_modules/graphql/error/GraphQLError.d.ts
generated
vendored
Normal file
152
node_modules/graphql/error/GraphQLError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
import type { Maybe } from '../jsutils/Maybe';
|
||||
import type { ASTNode } from '../language/ast';
|
||||
import type { SourceLocation } from '../language/location';
|
||||
import type { Source } from '../language/source';
|
||||
/**
|
||||
* Custom extensions
|
||||
*
|
||||
* @remarks
|
||||
* Use a unique identifier name for your extension, for example the name of
|
||||
* your library or project. Do not use a shortened identifier as this increases
|
||||
* the risk of conflicts. We recommend you add at most one extension field,
|
||||
* an object which can contain all the values you need.
|
||||
*/
|
||||
export interface GraphQLErrorExtensions {
|
||||
[attributeName: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* Custom formatted extensions
|
||||
*
|
||||
* @remarks
|
||||
* Use a unique identifier name for your extension, for example the name of
|
||||
* your library or project. Do not use a shortened identifier as this increases
|
||||
* the risk of conflicts. We recommend you add at most one extension field,
|
||||
* an object which can contain all the values you need.
|
||||
*/
|
||||
export interface GraphQLFormattedErrorExtensions {
|
||||
[attributeName: string]: unknown;
|
||||
}
|
||||
export 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?: Maybe<GraphQLErrorExtensions>;
|
||||
}
|
||||
/**
|
||||
* A GraphQLError describes an Error found during the parse, validate, or
|
||||
* execute phases of performing a GraphQL operation. In addition to a message
|
||||
* and stack trace, it also includes information about the locations in a
|
||||
* GraphQL document and/or execution result that correspond to the Error.
|
||||
*/
|
||||
export declare class GraphQLError extends Error {
|
||||
/**
|
||||
* An array of `{ line, column }` locations within the source GraphQL document
|
||||
* which correspond to this error.
|
||||
*
|
||||
* Errors during validation often contain multiple locations, for example to
|
||||
* point out two things with the same name. Errors during execution include a
|
||||
* single location, the field which produced the error.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*/
|
||||
readonly locations: ReadonlyArray<SourceLocation> | undefined;
|
||||
/**
|
||||
* An array describing the JSON-path into the execution response which
|
||||
* corresponds to this error. Only included for errors during execution.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*/
|
||||
readonly path: ReadonlyArray<string | number> | undefined;
|
||||
/**
|
||||
* An array of GraphQL AST Nodes corresponding to this error.
|
||||
*/
|
||||
readonly nodes: ReadonlyArray<ASTNode> | undefined;
|
||||
/**
|
||||
* The source GraphQL document for the first location of this error.
|
||||
*
|
||||
* Note that if this Error represents more than one node, the source may not
|
||||
* represent nodes after the first node.
|
||||
*/
|
||||
readonly source: Source | undefined;
|
||||
/**
|
||||
* An array of character offsets within the source GraphQL document
|
||||
* which correspond to this error.
|
||||
*/
|
||||
readonly positions: ReadonlyArray<number> | undefined;
|
||||
/**
|
||||
* The original error thrown from a field resolver during execution.
|
||||
*/
|
||||
readonly originalError: Error | undefined;
|
||||
/**
|
||||
* Extension fields to add to the formatted error.
|
||||
*/
|
||||
readonly extensions: GraphQLErrorExtensions;
|
||||
constructor(message: string, options?: GraphQLErrorOptions);
|
||||
/**
|
||||
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
||||
*/
|
||||
constructor(
|
||||
message: string,
|
||||
nodes?: ReadonlyArray<ASTNode> | ASTNode | null,
|
||||
source?: Maybe<Source>,
|
||||
positions?: Maybe<ReadonlyArray<number>>,
|
||||
path?: Maybe<ReadonlyArray<string | number>>,
|
||||
originalError?: Maybe<
|
||||
Error & {
|
||||
readonly extensions?: unknown;
|
||||
}
|
||||
>,
|
||||
extensions?: Maybe<GraphQLErrorExtensions>,
|
||||
);
|
||||
get [Symbol.toStringTag](): string;
|
||||
toString(): string;
|
||||
toJSON(): GraphQLFormattedError;
|
||||
}
|
||||
/**
|
||||
* See: https://spec.graphql.org/draft/#sec-Errors
|
||||
*/
|
||||
export interface GraphQLFormattedError {
|
||||
/**
|
||||
* A short, human-readable summary of the problem that **SHOULD NOT** change
|
||||
* from occurrence to occurrence of the problem, except for purposes of
|
||||
* localization.
|
||||
*/
|
||||
readonly message: string;
|
||||
/**
|
||||
* If an error can be associated to a particular point in the requested
|
||||
* GraphQL document, it should contain a list of locations.
|
||||
*/
|
||||
readonly locations?: ReadonlyArray<SourceLocation>;
|
||||
/**
|
||||
* If an error can be associated to a particular field in the GraphQL result,
|
||||
* it _must_ contain an entry with the key `path` that details the path of
|
||||
* the response field which experienced the error. This allows clients to
|
||||
* identify whether a null result is intentional or caused by a runtime error.
|
||||
*/
|
||||
readonly path?: ReadonlyArray<string | number>;
|
||||
/**
|
||||
* Reserved for implementors to extend the protocol however they see fit,
|
||||
* and hence there are no additional restrictions on its contents.
|
||||
*/
|
||||
readonly extensions?: GraphQLFormattedErrorExtensions;
|
||||
}
|
||||
/**
|
||||
* Prints a GraphQLError to a string, representing useful location information
|
||||
* about the error's position in the source.
|
||||
*
|
||||
* @deprecated Please use `error.toString` instead. Will be removed in v17
|
||||
*/
|
||||
export declare function printError(error: GraphQLError): string;
|
||||
/**
|
||||
* Given a GraphQLError, format it according to the rules described by the
|
||||
* Response Format, Errors section of the GraphQL Specification.
|
||||
*
|
||||
* @deprecated Please use `error.toJSON` instead. Will be removed in v17
|
||||
*/
|
||||
export declare function formatError(error: GraphQLError): GraphQLFormattedError;
|
||||
267
node_modules/graphql/error/GraphQLError.js
generated
vendored
Normal file
267
node_modules/graphql/error/GraphQLError.js
generated
vendored
Normal file
@@ -0,0 +1,267 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
exports.GraphQLError = void 0;
|
||||
exports.formatError = formatError;
|
||||
exports.printError = printError;
|
||||
|
||||
var _isObjectLike = require('../jsutils/isObjectLike.js');
|
||||
|
||||
var _location = require('../language/location.js');
|
||||
|
||||
var _printLocation = require('../language/printLocation.js');
|
||||
|
||||
function toNormalizedOptions(args) {
|
||||
const firstArg = args[0];
|
||||
|
||||
if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {
|
||||
return {
|
||||
nodes: firstArg,
|
||||
source: args[1],
|
||||
positions: args[2],
|
||||
path: args[3],
|
||||
originalError: args[4],
|
||||
extensions: args[5],
|
||||
};
|
||||
}
|
||||
|
||||
return firstArg;
|
||||
}
|
||||
/**
|
||||
* A GraphQLError describes an Error found during the parse, validate, or
|
||||
* execute phases of performing a GraphQL operation. In addition to a message
|
||||
* and stack trace, it also includes information about the locations in a
|
||||
* GraphQL document and/or execution result that correspond to the Error.
|
||||
*/
|
||||
|
||||
class GraphQLError extends Error {
|
||||
/**
|
||||
* An array of `{ line, column }` locations within the source GraphQL document
|
||||
* which correspond to this error.
|
||||
*
|
||||
* Errors during validation often contain multiple locations, for example to
|
||||
* point out two things with the same name. Errors during execution include a
|
||||
* single location, the field which produced the error.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*/
|
||||
|
||||
/**
|
||||
* An array describing the JSON-path into the execution response which
|
||||
* corresponds to this error. Only included for errors during execution.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*/
|
||||
|
||||
/**
|
||||
* An array of GraphQL AST Nodes corresponding to this error.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The source GraphQL document for the first location of this error.
|
||||
*
|
||||
* Note that if this Error represents more than one node, the source may not
|
||||
* represent nodes after the first node.
|
||||
*/
|
||||
|
||||
/**
|
||||
* An array of character offsets within the source GraphQL document
|
||||
* which correspond to this error.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The original error thrown from a field resolver during execution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Extension fields to add to the formatted error.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
||||
*/
|
||||
constructor(message, ...rawArgs) {
|
||||
var _this$nodes, _nodeLocations$, _ref;
|
||||
|
||||
const { nodes, source, positions, path, originalError, extensions } =
|
||||
toNormalizedOptions(rawArgs);
|
||||
super(message);
|
||||
this.name = 'GraphQLError';
|
||||
this.path = path !== null && path !== void 0 ? path : undefined;
|
||||
this.originalError =
|
||||
originalError !== null && originalError !== void 0
|
||||
? originalError
|
||||
: undefined; // Compute list of blame nodes.
|
||||
|
||||
this.nodes = undefinedIfEmpty(
|
||||
Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,
|
||||
);
|
||||
const nodeLocations = undefinedIfEmpty(
|
||||
(_this$nodes = this.nodes) === null || _this$nodes === void 0
|
||||
? void 0
|
||||
: _this$nodes.map((node) => node.loc).filter((loc) => loc != null),
|
||||
); // Compute locations in the source for the given nodes/positions.
|
||||
|
||||
this.source =
|
||||
source !== null && source !== void 0
|
||||
? source
|
||||
: nodeLocations === null || nodeLocations === void 0
|
||||
? void 0
|
||||
: (_nodeLocations$ = nodeLocations[0]) === null ||
|
||||
_nodeLocations$ === void 0
|
||||
? void 0
|
||||
: _nodeLocations$.source;
|
||||
this.positions =
|
||||
positions !== null && positions !== void 0
|
||||
? positions
|
||||
: nodeLocations === null || nodeLocations === void 0
|
||||
? void 0
|
||||
: nodeLocations.map((loc) => loc.start);
|
||||
this.locations =
|
||||
positions && source
|
||||
? positions.map((pos) => (0, _location.getLocation)(source, pos))
|
||||
: nodeLocations === null || nodeLocations === void 0
|
||||
? void 0
|
||||
: nodeLocations.map((loc) =>
|
||||
(0, _location.getLocation)(loc.source, loc.start),
|
||||
);
|
||||
const originalExtensions = (0, _isObjectLike.isObjectLike)(
|
||||
originalError === null || originalError === void 0
|
||||
? void 0
|
||||
: originalError.extensions,
|
||||
)
|
||||
? originalError === null || originalError === void 0
|
||||
? void 0
|
||||
: originalError.extensions
|
||||
: undefined;
|
||||
this.extensions =
|
||||
(_ref =
|
||||
extensions !== null && extensions !== void 0
|
||||
? extensions
|
||||
: originalExtensions) !== null && _ref !== void 0
|
||||
? _ref
|
||||
: Object.create(null); // Only properties prescribed by the spec should be enumerable.
|
||||
// Keep the rest as non-enumerable.
|
||||
|
||||
Object.defineProperties(this, {
|
||||
message: {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
},
|
||||
name: {
|
||||
enumerable: false,
|
||||
},
|
||||
nodes: {
|
||||
enumerable: false,
|
||||
},
|
||||
source: {
|
||||
enumerable: false,
|
||||
},
|
||||
positions: {
|
||||
enumerable: false,
|
||||
},
|
||||
originalError: {
|
||||
enumerable: false,
|
||||
},
|
||||
}); // Include (non-enumerable) stack trace.
|
||||
|
||||
/* c8 ignore start */
|
||||
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
||||
|
||||
if (
|
||||
originalError !== null &&
|
||||
originalError !== void 0 &&
|
||||
originalError.stack
|
||||
) {
|
||||
Object.defineProperty(this, 'stack', {
|
||||
value: originalError.stack,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
} else if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, GraphQLError);
|
||||
} else {
|
||||
Object.defineProperty(this, 'stack', {
|
||||
value: Error().stack,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return 'GraphQLError';
|
||||
}
|
||||
|
||||
toString() {
|
||||
let output = this.message;
|
||||
|
||||
if (this.nodes) {
|
||||
for (const node of this.nodes) {
|
||||
if (node.loc) {
|
||||
output += '\n\n' + (0, _printLocation.printLocation)(node.loc);
|
||||
}
|
||||
}
|
||||
} else if (this.source && this.locations) {
|
||||
for (const location of this.locations) {
|
||||
output +=
|
||||
'\n\n' +
|
||||
(0, _printLocation.printSourceLocation)(this.source, location);
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
const formattedError = {
|
||||
message: this.message,
|
||||
};
|
||||
|
||||
if (this.locations != null) {
|
||||
formattedError.locations = this.locations;
|
||||
}
|
||||
|
||||
if (this.path != null) {
|
||||
formattedError.path = this.path;
|
||||
}
|
||||
|
||||
if (this.extensions != null && Object.keys(this.extensions).length > 0) {
|
||||
formattedError.extensions = this.extensions;
|
||||
}
|
||||
|
||||
return formattedError;
|
||||
}
|
||||
}
|
||||
|
||||
exports.GraphQLError = GraphQLError;
|
||||
|
||||
function undefinedIfEmpty(array) {
|
||||
return array === undefined || array.length === 0 ? undefined : array;
|
||||
}
|
||||
/**
|
||||
* See: https://spec.graphql.org/draft/#sec-Errors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Prints a GraphQLError to a string, representing useful location information
|
||||
* about the error's position in the source.
|
||||
*
|
||||
* @deprecated Please use `error.toString` instead. Will be removed in v17
|
||||
*/
|
||||
function printError(error) {
|
||||
return error.toString();
|
||||
}
|
||||
/**
|
||||
* Given a GraphQLError, format it according to the rules described by the
|
||||
* Response Format, Errors section of the GraphQL Specification.
|
||||
*
|
||||
* @deprecated Please use `error.toJSON` instead. Will be removed in v17
|
||||
*/
|
||||
|
||||
function formatError(error) {
|
||||
return error.toJSON();
|
||||
}
|
||||
253
node_modules/graphql/error/GraphQLError.mjs
generated
vendored
Normal file
253
node_modules/graphql/error/GraphQLError.mjs
generated
vendored
Normal file
@@ -0,0 +1,253 @@
|
||||
import { isObjectLike } from '../jsutils/isObjectLike.mjs';
|
||||
import { getLocation } from '../language/location.mjs';
|
||||
import {
|
||||
printLocation,
|
||||
printSourceLocation,
|
||||
} from '../language/printLocation.mjs';
|
||||
|
||||
function toNormalizedOptions(args) {
|
||||
const firstArg = args[0];
|
||||
|
||||
if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {
|
||||
return {
|
||||
nodes: firstArg,
|
||||
source: args[1],
|
||||
positions: args[2],
|
||||
path: args[3],
|
||||
originalError: args[4],
|
||||
extensions: args[5],
|
||||
};
|
||||
}
|
||||
|
||||
return firstArg;
|
||||
}
|
||||
/**
|
||||
* A GraphQLError describes an Error found during the parse, validate, or
|
||||
* execute phases of performing a GraphQL operation. In addition to a message
|
||||
* and stack trace, it also includes information about the locations in a
|
||||
* GraphQL document and/or execution result that correspond to the Error.
|
||||
*/
|
||||
|
||||
export class GraphQLError extends Error {
|
||||
/**
|
||||
* An array of `{ line, column }` locations within the source GraphQL document
|
||||
* which correspond to this error.
|
||||
*
|
||||
* Errors during validation often contain multiple locations, for example to
|
||||
* point out two things with the same name. Errors during execution include a
|
||||
* single location, the field which produced the error.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*/
|
||||
|
||||
/**
|
||||
* An array describing the JSON-path into the execution response which
|
||||
* corresponds to this error. Only included for errors during execution.
|
||||
*
|
||||
* Enumerable, and appears in the result of JSON.stringify().
|
||||
*/
|
||||
|
||||
/**
|
||||
* An array of GraphQL AST Nodes corresponding to this error.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The source GraphQL document for the first location of this error.
|
||||
*
|
||||
* Note that if this Error represents more than one node, the source may not
|
||||
* represent nodes after the first node.
|
||||
*/
|
||||
|
||||
/**
|
||||
* An array of character offsets within the source GraphQL document
|
||||
* which correspond to this error.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The original error thrown from a field resolver during execution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Extension fields to add to the formatted error.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
||||
*/
|
||||
constructor(message, ...rawArgs) {
|
||||
var _this$nodes, _nodeLocations$, _ref;
|
||||
|
||||
const { nodes, source, positions, path, originalError, extensions } =
|
||||
toNormalizedOptions(rawArgs);
|
||||
super(message);
|
||||
this.name = 'GraphQLError';
|
||||
this.path = path !== null && path !== void 0 ? path : undefined;
|
||||
this.originalError =
|
||||
originalError !== null && originalError !== void 0
|
||||
? originalError
|
||||
: undefined; // Compute list of blame nodes.
|
||||
|
||||
this.nodes = undefinedIfEmpty(
|
||||
Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,
|
||||
);
|
||||
const nodeLocations = undefinedIfEmpty(
|
||||
(_this$nodes = this.nodes) === null || _this$nodes === void 0
|
||||
? void 0
|
||||
: _this$nodes.map((node) => node.loc).filter((loc) => loc != null),
|
||||
); // Compute locations in the source for the given nodes/positions.
|
||||
|
||||
this.source =
|
||||
source !== null && source !== void 0
|
||||
? source
|
||||
: nodeLocations === null || nodeLocations === void 0
|
||||
? void 0
|
||||
: (_nodeLocations$ = nodeLocations[0]) === null ||
|
||||
_nodeLocations$ === void 0
|
||||
? void 0
|
||||
: _nodeLocations$.source;
|
||||
this.positions =
|
||||
positions !== null && positions !== void 0
|
||||
? positions
|
||||
: nodeLocations === null || nodeLocations === void 0
|
||||
? void 0
|
||||
: nodeLocations.map((loc) => loc.start);
|
||||
this.locations =
|
||||
positions && source
|
||||
? positions.map((pos) => getLocation(source, pos))
|
||||
: nodeLocations === null || nodeLocations === void 0
|
||||
? void 0
|
||||
: nodeLocations.map((loc) => getLocation(loc.source, loc.start));
|
||||
const originalExtensions = isObjectLike(
|
||||
originalError === null || originalError === void 0
|
||||
? void 0
|
||||
: originalError.extensions,
|
||||
)
|
||||
? originalError === null || originalError === void 0
|
||||
? void 0
|
||||
: originalError.extensions
|
||||
: undefined;
|
||||
this.extensions =
|
||||
(_ref =
|
||||
extensions !== null && extensions !== void 0
|
||||
? extensions
|
||||
: originalExtensions) !== null && _ref !== void 0
|
||||
? _ref
|
||||
: Object.create(null); // Only properties prescribed by the spec should be enumerable.
|
||||
// Keep the rest as non-enumerable.
|
||||
|
||||
Object.defineProperties(this, {
|
||||
message: {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
},
|
||||
name: {
|
||||
enumerable: false,
|
||||
},
|
||||
nodes: {
|
||||
enumerable: false,
|
||||
},
|
||||
source: {
|
||||
enumerable: false,
|
||||
},
|
||||
positions: {
|
||||
enumerable: false,
|
||||
},
|
||||
originalError: {
|
||||
enumerable: false,
|
||||
},
|
||||
}); // Include (non-enumerable) stack trace.
|
||||
|
||||
/* c8 ignore start */
|
||||
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
||||
|
||||
if (
|
||||
originalError !== null &&
|
||||
originalError !== void 0 &&
|
||||
originalError.stack
|
||||
) {
|
||||
Object.defineProperty(this, 'stack', {
|
||||
value: originalError.stack,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
} else if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, GraphQLError);
|
||||
} else {
|
||||
Object.defineProperty(this, 'stack', {
|
||||
value: Error().stack,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return 'GraphQLError';
|
||||
}
|
||||
|
||||
toString() {
|
||||
let output = this.message;
|
||||
|
||||
if (this.nodes) {
|
||||
for (const node of this.nodes) {
|
||||
if (node.loc) {
|
||||
output += '\n\n' + printLocation(node.loc);
|
||||
}
|
||||
}
|
||||
} else if (this.source && this.locations) {
|
||||
for (const location of this.locations) {
|
||||
output += '\n\n' + printSourceLocation(this.source, location);
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
const formattedError = {
|
||||
message: this.message,
|
||||
};
|
||||
|
||||
if (this.locations != null) {
|
||||
formattedError.locations = this.locations;
|
||||
}
|
||||
|
||||
if (this.path != null) {
|
||||
formattedError.path = this.path;
|
||||
}
|
||||
|
||||
if (this.extensions != null && Object.keys(this.extensions).length > 0) {
|
||||
formattedError.extensions = this.extensions;
|
||||
}
|
||||
|
||||
return formattedError;
|
||||
}
|
||||
}
|
||||
|
||||
function undefinedIfEmpty(array) {
|
||||
return array === undefined || array.length === 0 ? undefined : array;
|
||||
}
|
||||
/**
|
||||
* See: https://spec.graphql.org/draft/#sec-Errors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Prints a GraphQLError to a string, representing useful location information
|
||||
* about the error's position in the source.
|
||||
*
|
||||
* @deprecated Please use `error.toString` instead. Will be removed in v17
|
||||
*/
|
||||
export function printError(error) {
|
||||
return error.toString();
|
||||
}
|
||||
/**
|
||||
* Given a GraphQLError, format it according to the rules described by the
|
||||
* Response Format, Errors section of the GraphQL Specification.
|
||||
*
|
||||
* @deprecated Please use `error.toJSON` instead. Will be removed in v17
|
||||
*/
|
||||
|
||||
export function formatError(error) {
|
||||
return error.toJSON();
|
||||
}
|
||||
9
node_modules/graphql/error/index.d.ts
generated
vendored
Normal file
9
node_modules/graphql/error/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export { GraphQLError, printError, formatError } from './GraphQLError';
|
||||
export type {
|
||||
GraphQLErrorOptions,
|
||||
GraphQLFormattedError,
|
||||
GraphQLErrorExtensions,
|
||||
GraphQLFormattedErrorExtensions,
|
||||
} from './GraphQLError';
|
||||
export { syntaxError } from './syntaxError';
|
||||
export { locatedError } from './locatedError';
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user