mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Update to graphql v14.0.0
Update to v14.0.0 from v14.0.0-rc.2, diff: https://github.com/graphql/graphql-js/compare/9b7807a8ff20c6f2565577af8d90530acc49230d...v14.0.0
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ export class GraphQLError extends Error {
|
||||
/**
|
||||
* The original error thrown from a field resolver during execution.
|
||||
*/
|
||||
readonly originalError: Maybe<Error>;
|
||||
readonly originalError: Maybe<Error> & { readonly extensions: any };
|
||||
|
||||
/**
|
||||
* Extension fields to add to the formatted error.
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLError } from "../error";
|
||||
import { GraphQLError } from "../error/GraphQLError";
|
||||
import { GraphQLInputType, GraphQLField, GraphQLArgument } from "../type/definition";
|
||||
import { GraphQLDirective } from "../type/directives";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
|
||||
Vendored
+5
@@ -22,6 +22,11 @@ import { ExecutionResult, ExecutionResultDataDefault } from "./execution/execute
|
||||
* 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.
|
||||
|
||||
Vendored
+18
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for graphql 0.13
|
||||
// Type definitions for graphql 14.0
|
||||
// Project: https://www.npmjs.com/package/graphql
|
||||
// Definitions by: TonyYang <https://github.com/TonyPythoneer>
|
||||
// Caleb Meredith <https://github.com/calebmer>
|
||||
@@ -84,6 +84,8 @@ export {
|
||||
isWrappingType,
|
||||
isNullableType,
|
||||
isNamedType,
|
||||
isRequiredArgument,
|
||||
isRequiredInputField,
|
||||
isSpecifiedScalarType,
|
||||
isIntrospectionType,
|
||||
isSpecifiedDirective,
|
||||
@@ -149,6 +151,9 @@ export {
|
||||
GraphQLTypeResolver,
|
||||
GraphQLUnionTypeConfig,
|
||||
GraphQLDirectiveConfig,
|
||||
GraphQLScalarSerializer,
|
||||
GraphQLScalarValueParser,
|
||||
GraphQLScalarLiteralParser,
|
||||
} from "./type";
|
||||
|
||||
// Parse and operate on GraphQL language source files.
|
||||
@@ -170,6 +175,16 @@ export {
|
||||
TokenKind,
|
||||
DirectiveLocation,
|
||||
BREAK,
|
||||
// Predicates
|
||||
isDefinitionNode,
|
||||
isExecutableDefinitionNode,
|
||||
isSelectionNode,
|
||||
isValueNode,
|
||||
isTypeNode,
|
||||
isTypeSystemDefinitionNode,
|
||||
isTypeDefinitionNode,
|
||||
isTypeSystemExtensionNode,
|
||||
isTypeExtensionNode,
|
||||
// type
|
||||
Lexer,
|
||||
ParseOptions,
|
||||
@@ -311,7 +326,8 @@ export {
|
||||
buildASTSchema,
|
||||
// Build a GraphQLSchema from a GraphQL schema language document.
|
||||
buildSchema,
|
||||
// Get the description from a schema AST node.
|
||||
// @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.
|
||||
|
||||
Vendored
+1
@@ -211,6 +211,7 @@ export interface VariableDefinitionNode {
|
||||
readonly variable: VariableNode;
|
||||
readonly type: TypeNode;
|
||||
readonly defaultValue?: ValueNode;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
}
|
||||
|
||||
export interface VariableNode {
|
||||
|
||||
@@ -13,6 +13,7 @@ type _DirectiveLocation = {
|
||||
FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION";
|
||||
FRAGMENT_SPREAD: "FRAGMENT_SPREAD";
|
||||
INLINE_FRAGMENT: "INLINE_FRAGMENT";
|
||||
VARIABLE_DEFINITION: "VARIABLE_DEFINITION";
|
||||
|
||||
// Type System Definitions
|
||||
SCHEMA: "SCHEMA";
|
||||
|
||||
Vendored
+12
@@ -78,4 +78,16 @@ export {
|
||||
InputObjectTypeExtensionNode,
|
||||
} from "./ast";
|
||||
|
||||
export {
|
||||
isDefinitionNode,
|
||||
isExecutableDefinitionNode,
|
||||
isSelectionNode,
|
||||
isValueNode,
|
||||
isTypeNode,
|
||||
isTypeSystemDefinitionNode,
|
||||
isTypeDefinitionNode,
|
||||
isTypeSystemExtensionNode,
|
||||
isTypeExtensionNode,
|
||||
} from "./predicates";
|
||||
|
||||
export { DirectiveLocation, DirectiveLocationEnum } from "./directiveLocation";
|
||||
|
||||
Vendored
+1
-1
@@ -12,7 +12,6 @@ type _Kind = {
|
||||
DOCUMENT: "Document";
|
||||
OPERATION_DEFINITION: "OperationDefinition";
|
||||
VARIABLE_DEFINITION: "VariableDefinition";
|
||||
VARIABLE: "Variable";
|
||||
SELECTION_SET: "SelectionSet";
|
||||
FIELD: "Field";
|
||||
ARGUMENT: "Argument";
|
||||
@@ -23,6 +22,7 @@ type _Kind = {
|
||||
FRAGMENT_DEFINITION: "FragmentDefinition";
|
||||
|
||||
// Values
|
||||
VARIABLE: "Variable";
|
||||
INT: "IntValue";
|
||||
FLOAT: "FloatValue";
|
||||
STRING: "StringValue";
|
||||
|
||||
Vendored
+11
@@ -50,6 +50,17 @@ export interface ParseOptions {
|
||||
* future.
|
||||
*/
|
||||
experimentalFragmentVariables?: boolean;
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL:
|
||||
*
|
||||
* If enabled, the parser understands directives on variable definitions:
|
||||
*
|
||||
* query Foo($var: String = "abc" @variable_definition_directive) {
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
experimentalVariableDefinitionDirectives?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
import { ASTNode } from "./ast";
|
||||
|
||||
export function isDefinitionNode(node: ASTNode): boolean;
|
||||
|
||||
export function isExecutableDefinitionNode(node: ASTNode): boolean;
|
||||
|
||||
export function isSelectionNode(node: ASTNode): boolean;
|
||||
|
||||
export function isValueNode(node: ASTNode): boolean;
|
||||
|
||||
export function isTypeNode(node: ASTNode): boolean;
|
||||
|
||||
export function isTypeSystemDefinitionNode(node: ASTNode): boolean;
|
||||
|
||||
export function isTypeDefinitionNode(node: ASTNode): boolean;
|
||||
|
||||
export function isTypeSystemExtensionNode(node: ASTNode): boolean;
|
||||
|
||||
export function isTypeExtensionNode(node: ASTNode): boolean;
|
||||
Vendored
+22
-14
@@ -156,7 +156,7 @@ export function assertAbstractType(type: any): GraphQLAbstractType;
|
||||
*/
|
||||
export class GraphQLList<T extends GraphQLType> {
|
||||
readonly ofType: T;
|
||||
constructor(type: T);
|
||||
constructor(ofType: T);
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
@@ -184,7 +184,7 @@ export class GraphQLList<T extends GraphQLType> {
|
||||
*/
|
||||
export class GraphQLNonNull<T extends GraphQLNullableType> {
|
||||
readonly ofType: T;
|
||||
constructor(type: T);
|
||||
constructor(ofType: T);
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
inspect(): string;
|
||||
@@ -260,32 +260,36 @@ export type Thunk<T> = (() => T) | T;
|
||||
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>);
|
||||
|
||||
// Serializes an internal value to include in a response.
|
||||
serialize(value: any): any;
|
||||
|
||||
// Parses an externally provided value to use as an input.
|
||||
parseValue(value: any): any;
|
||||
|
||||
// Parses an externally provided literal value to use as an input.
|
||||
parseLiteral(valueNode: ValueNode, variables?: Maybe<{ [key: string]: any }>): any;
|
||||
|
||||
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>>;
|
||||
serialize(value: any): Maybe<TExternal>;
|
||||
parseValue?(value: any): Maybe<TInternal>;
|
||||
parseLiteral?(valueNode: ValueNode, variables: Maybe<{ [key: string]: any }>): Maybe<TInternal>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -430,6 +434,8 @@ export interface GraphQLArgument {
|
||||
astNode?: Maybe<InputValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export function isRequiredArgument(arg: GraphQLArgument): boolean;
|
||||
|
||||
export type GraphQLFieldMap<TSource, TContext> = {
|
||||
[key: string]: GraphQLField<TSource, TContext>;
|
||||
};
|
||||
@@ -658,4 +664,6 @@ export interface GraphQLInputField {
|
||||
astNode?: Maybe<InputValueDefinitionNode>;
|
||||
}
|
||||
|
||||
export function isRequiredInputField(field: GraphQLInputField): boolean;
|
||||
|
||||
export type GraphQLInputFieldMap = { [key: string]: GraphQLInputField };
|
||||
|
||||
Vendored
+5
@@ -25,6 +25,8 @@ export {
|
||||
isWrappingType,
|
||||
isNullableType,
|
||||
isNamedType,
|
||||
isRequiredArgument,
|
||||
isRequiredInputField,
|
||||
// Assertions
|
||||
assertType,
|
||||
assertScalarType,
|
||||
@@ -92,6 +94,9 @@ export {
|
||||
GraphQLScalarTypeConfig,
|
||||
GraphQLTypeResolver,
|
||||
GraphQLUnionTypeConfig,
|
||||
GraphQLScalarSerializer,
|
||||
GraphQLScalarValueParser,
|
||||
GraphQLScalarLiteralParser,
|
||||
} from "./definition";
|
||||
|
||||
export {
|
||||
|
||||
Vendored
+1
-2
@@ -71,8 +71,7 @@ export interface GraphQLSchemaValidationOptions {
|
||||
* 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 may be removed in a future
|
||||
* major release.
|
||||
* This option is provided to ease adoption and will be removed in v15.
|
||||
*/
|
||||
allowedLegacyNames?: Maybe<ReadonlyArray<string>>;
|
||||
}
|
||||
|
||||
+10
-1
@@ -22,10 +22,18 @@ 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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +52,7 @@ interface BuildSchemaOptions extends GraphQLSchemaValidationOptions {
|
||||
* Provide true to use preceding comments as the description.
|
||||
*
|
||||
*/
|
||||
export function buildASTSchema(ast: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema;
|
||||
export function buildASTSchema(documentAST: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema;
|
||||
|
||||
type TypeDefinitionsMap = { [key: string]: TypeDefinitionNode };
|
||||
type TypeResolver = (typeRef: NamedTypeNode) => GraphQLNamedType;
|
||||
@@ -67,6 +75,7 @@ export class ASTDefinitionBuilder {
|
||||
|
||||
/**
|
||||
* 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:
|
||||
*
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { GraphQLError } from "../error";
|
||||
import { GraphQLError } from "../error/GraphQLError";
|
||||
import { ASTNode } from "../language/ast";
|
||||
import { GraphQLInputType } from "../type/definition";
|
||||
|
||||
|
||||
+8
@@ -7,10 +7,18 @@ 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+6
-6
@@ -12,7 +12,7 @@ import { GraphQLDirective } from "../type/directives";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { DirectiveLocationEnum } from "../language/directiveLocation";
|
||||
|
||||
export const BreakingChangeType : _BreakingChangeType;
|
||||
export const BreakingChangeType: _BreakingChangeType;
|
||||
|
||||
// @internal
|
||||
type _BreakingChangeType = {
|
||||
@@ -24,13 +24,13 @@ type _BreakingChangeType = {
|
||||
VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM";
|
||||
ARG_REMOVED: "ARG_REMOVED";
|
||||
ARG_CHANGED_KIND: "ARG_CHANGED_KIND";
|
||||
NON_NULL_ARG_ADDED: "NON_NULL_ARG_ADDED";
|
||||
NON_NULL_INPUT_FIELD_ADDED: "NON_NULL_INPUT_FIELD_ADDED";
|
||||
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";
|
||||
NON_NULL_DIRECTIVE_ARG_ADDED: "NON_NULL_DIRECTIVE_ARG_ADDED";
|
||||
REQUIRED_DIRECTIVE_ARG_ADDED: "REQUIRED_DIRECTIVE_ARG_ADDED";
|
||||
};
|
||||
|
||||
export const DangerousChangeType: _DangerousChangeType;
|
||||
@@ -41,8 +41,8 @@ type _DangerousChangeType = {
|
||||
VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM";
|
||||
INTERFACE_ADDED_TO_OBJECT: "INTERFACE_ADDED_TO_OBJECT";
|
||||
TYPE_ADDED_TO_UNION: "TYPE_ADDED_TO_UNION";
|
||||
NULLABLE_INPUT_FIELD_ADDED: "NULLABLE_INPUT_FIELD_ADDED";
|
||||
NULLABLE_ARG_ADDED: "NULLABLE_ARG_ADDED";
|
||||
OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED";
|
||||
OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED";
|
||||
};
|
||||
|
||||
export interface BreakingChange {
|
||||
|
||||
Vendored
+8
-1
@@ -43,7 +43,14 @@ export { introspectionFromSchema } from "./introspectionFromSchema";
|
||||
export { buildClientSchema } from "./buildClientSchema";
|
||||
|
||||
// Build a GraphQLSchema from GraphQL Schema language.
|
||||
export { buildASTSchema, buildSchema, getDescription, BuildSchemaOptions } from "./buildASTSchema";
|
||||
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";
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ import { IntrospectionQuery, IntrospectionOptions } from "./introspectionQuery";
|
||||
* 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;
|
||||
export function introspectionFromSchema(schema: GraphQLSchema, options?: IntrospectionOptions): IntrospectionQuery;
|
||||
|
||||
+8
@@ -2,6 +2,14 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
+19
-4
@@ -18,6 +18,7 @@ import {
|
||||
} from "../type/definition";
|
||||
import { GraphQLDirective } from "../type/directives";
|
||||
import { TypeInfo } from "../utilities/TypeInfo";
|
||||
import { ASTVisitor } from "../language/visitor";
|
||||
|
||||
type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode;
|
||||
type VariableUsage = {
|
||||
@@ -31,16 +32,28 @@ type VariableUsage = {
|
||||
* allowing access to commonly useful contextual information from within a
|
||||
* validation rule.
|
||||
*/
|
||||
export default class ValidationContext {
|
||||
constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo);
|
||||
export class ASTValidationContext {
|
||||
constructor(ast: DocumentNode);
|
||||
|
||||
reportError(error: GraphQLError): undefined;
|
||||
|
||||
getErrors(): ReadonlyArray<GraphQLError>;
|
||||
|
||||
getSchema(): GraphQLSchema;
|
||||
|
||||
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>;
|
||||
|
||||
@@ -66,3 +79,5 @@ export default class ValidationContext {
|
||||
|
||||
getArgument(): Maybe<GraphQLArgument>;
|
||||
}
|
||||
|
||||
export type ValidationRule = (context: ValidationContext) => ASTVisitor;
|
||||
|
||||
Vendored
+1
-2
@@ -1,7 +1,6 @@
|
||||
export { validate } from "./validate";
|
||||
|
||||
import ValidationContext from "./ValidationContext";
|
||||
export { ValidationContext };
|
||||
export { ValidationContext } from "./ValidationContext";
|
||||
|
||||
export { specifiedRules } from "./specifiedRules";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function nonExecutableDefinitionMessage(defName: string): string;
|
||||
@@ -9,4 +9,4 @@ export function nonExecutableDefinitionMessage(defName: string): string;
|
||||
* A GraphQL document is only valid for execution if all definitions are either
|
||||
* operation or fragment definitions.
|
||||
*/
|
||||
export function ExecutableDefinitions(context: ValidationContext): ASTVisitor;
|
||||
export function ExecutableDefinitions(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function inlineFragmentOnNonCompositeErrorMessage(type: string): string;
|
||||
|
||||
+4
-1
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext, SDLValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unknownArgMessage(
|
||||
@@ -21,3 +21,6 @@ export function unknownDirectiveArgMessage(
|
||||
* that field.
|
||||
*/
|
||||
export function KnownArgumentNames(context: ValidationContext): ASTVisitor;
|
||||
|
||||
// @internal
|
||||
export function KnownArgumentNamesOnDirectives(context: ValidationContext | SDLValidationContext): ASTVisitor;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext, SDLValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unknownDirectiveMessage(directiveName: string): string;
|
||||
@@ -11,4 +11,4 @@ export function misplacedDirectiveMessage(directiveName: string, location: strin
|
||||
* A GraphQL document is only valid if all `@directives` are known by the
|
||||
* schema and legally positioned.
|
||||
*/
|
||||
export function KnownDirectives(context: ValidationContext): ASTVisitor;
|
||||
export function KnownDirectives(context: ValidationContext | SDLValidationContext): ASTVisitor;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unknownFragmentMessage(fragName: string): string;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unknownTypeMessage(typeName: string, suggestedTypes: Array<string>): string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function anonOperationNotAloneMessage(): string;
|
||||
@@ -9,4 +9,4 @@ export function anonOperationNotAloneMessage(): string;
|
||||
* 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: ValidationContext): ASTVisitor;
|
||||
export function LoneAnonymousOperation(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
@@ -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;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function cycleErrorMessage(fragName: string, spreadNames: Array<string>): string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Maybe from "../../tsutils/Maybe";
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function undefinedVarMessage(varName: string, opName: Maybe<string>): string;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unusedFragMessage(fragName: string): string;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import Maybe from "../../tsutils/Maybe";
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function unusedVariableMessage(varName: string, opName: Maybe<string>): string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function fieldsConflictMessage(responseName: string, reason: ConflictReasonMessage): string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function typeIncompatibleSpreadMessage(fragName: string, parentType: string, fragType: string): string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext, SDLValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function missingFieldArgMessage(fieldName: string, argName: string, type: string): string;
|
||||
@@ -12,3 +12,6 @@ export function missingDirectiveArgMessage(directiveName: string, argName: strin
|
||||
* default value) field arguments have been provided.
|
||||
*/
|
||||
export function ProvidedRequiredArguments(context: ValidationContext): ASTVisitor;
|
||||
|
||||
// @internal
|
||||
export function ProvidedRequiredArgumentsOnDirectives(context: ValidationContext | SDLValidationContext): ASTVisitor;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function noSubselectionAllowedMessage(fieldName: string, type: string): string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Maybe from "../../tsutils/Maybe";
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function singleFieldOnlyMessage(name: Maybe<string>): string;
|
||||
@@ -9,4 +9,4 @@ export function singleFieldOnlyMessage(name: Maybe<string>): string;
|
||||
*
|
||||
* A GraphQL subscription is valid only if it contains a single root field.
|
||||
*/
|
||||
export function SingleFieldSubscriptions(context: ValidationContext): ASTVisitor;
|
||||
export function SingleFieldSubscriptions(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateArgMessage(argName: string): string;
|
||||
@@ -9,4 +9,4 @@ export function duplicateArgMessage(argName: string): string;
|
||||
* A GraphQL field or directive is only valid if all supplied arguments are
|
||||
* uniquely named.
|
||||
*/
|
||||
export function UniqueArgumentNames(context: ValidationContext): ASTVisitor;
|
||||
export function UniqueArgumentNames(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateDirectiveMessage(directiveName: string): string;
|
||||
@@ -9,4 +9,4 @@ export function duplicateDirectiveMessage(directiveName: string): string;
|
||||
* A GraphQL document is only valid if all directives at a given location
|
||||
* are uniquely named.
|
||||
*/
|
||||
export function UniqueDirectivesPerLocation(context: ValidationContext): ASTVisitor;
|
||||
export function UniqueDirectivesPerLocation(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateFragmentNameMessage(fragName: string): string;
|
||||
@@ -8,4 +8,4 @@ export function duplicateFragmentNameMessage(fragName: string): string;
|
||||
*
|
||||
* A GraphQL document is only valid if all defined fragments have unique names.
|
||||
*/
|
||||
export function UniqueFragmentNames(context: ValidationContext): ASTVisitor;
|
||||
export function UniqueFragmentNames(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateInputFieldMessage(fieldName: string): string;
|
||||
@@ -9,4 +9,4 @@ export function duplicateInputFieldMessage(fieldName: string): string;
|
||||
* A GraphQL input object value is only valid if all supplied fields are
|
||||
* uniquely named.
|
||||
*/
|
||||
export function UniqueInputFieldNames(context: ValidationContext): ASTVisitor;
|
||||
export function UniqueInputFieldNames(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateOperationNameMessage(operationName: string): string;
|
||||
@@ -8,4 +8,4 @@ export function duplicateOperationNameMessage(operationName: string): string;
|
||||
*
|
||||
* A GraphQL document is only valid if all defined operations have unique names.
|
||||
*/
|
||||
export function UniqueOperationNames(context: ValidationContext): ASTVisitor;
|
||||
export function UniqueOperationNames(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function duplicateVariableMessage(variableName: string): string;
|
||||
@@ -8,4 +8,4 @@ export function duplicateVariableMessage(variableName: string): string;
|
||||
*
|
||||
* A GraphQL operation is only valid if all its variables are uniquely named.
|
||||
*/
|
||||
export function UniqueVariableNames(context: ValidationContext): ASTVisitor;
|
||||
export function UniqueVariableNames(context: ASTValidationContext): ASTVisitor;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function badValueMessage(typeName: string, valueName: string, message?: string): string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function nonInputTypeOnVarMessage(variableName: string, typeName: string): string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ValidationContext } from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
|
||||
export function badVarPosMessage(varName: string, varType: string, expectedType: string): string;
|
||||
|
||||
+6
-3
@@ -1,3 +1,5 @@
|
||||
import { ValidationRule, SDLValidationRule } from "./ValidationContext";
|
||||
|
||||
// Spec Section: "Executable Definitions"
|
||||
import { ExecutableDefinitions } from "./rules/ExecutableDefinitions";
|
||||
|
||||
@@ -76,12 +78,13 @@ import { OverlappingFieldsCanBeMerged } from "./rules/OverlappingFieldsCanBeMerg
|
||||
// Spec Section: "Input Object Field Uniqueness"
|
||||
import { UniqueInputFieldNames } from "./rules/UniqueInputFieldNames";
|
||||
|
||||
import ValidationContext from "./ValidationContext";
|
||||
|
||||
/**
|
||||
* 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: Array<(context: ValidationContext) => any>;
|
||||
export const specifiedRules: ReadonlyArray<ValidationRule>;
|
||||
|
||||
// @internal
|
||||
export const specifiedSDLRules: ReadonlyArray<SDLValidationRule>;
|
||||
|
||||
+19
-2
@@ -2,6 +2,7 @@ import { GraphQLError } from "../error";
|
||||
import { DocumentNode } from "../language/ast";
|
||||
import { GraphQLSchema } from "../type/schema";
|
||||
import { TypeInfo } from "../utilities/TypeInfo";
|
||||
import { ValidationRule } from "./ValidationContext";
|
||||
|
||||
/**
|
||||
* Implements the "Validation" section of the spec.
|
||||
@@ -21,7 +22,23 @@ import { TypeInfo } from "../utilities/TypeInfo";
|
||||
*/
|
||||
export function validate(
|
||||
schema: GraphQLSchema,
|
||||
ast: DocumentNode,
|
||||
rules?: ReadonlyArray<any>,
|
||||
documentAST: DocumentNode,
|
||||
rules?: ReadonlyArray<ValidationRule>,
|
||||
typeInfo?: TypeInfo
|
||||
): ReadonlyArray<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;
|
||||
|
||||
Reference in New Issue
Block a user