mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
update to graphql v14.0.0 (WIP) (#26601)
GraphQL.js v14.0.0 has not been released yet, this commit is sync to 9b7807a8ff
This commit is contained in:
2
types/graphql/error/GraphQLError.d.ts
vendored
2
types/graphql/error/GraphQLError.d.ts
vendored
@@ -64,7 +64,7 @@ export class GraphQLError extends Error {
|
||||
/**
|
||||
* Extension fields to add to the formatted error.
|
||||
*/
|
||||
readonly extensions: { [key: string]: any } | void;
|
||||
readonly extensions: { [key: string]: any } | undefined;
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
|
||||
3
types/graphql/error/formatError.d.ts
vendored
3
types/graphql/error/formatError.d.ts
vendored
@@ -11,6 +11,5 @@ export interface GraphQLFormattedError {
|
||||
readonly message: string;
|
||||
readonly locations: ReadonlyArray<SourceLocation> | undefined;
|
||||
readonly path: ReadonlyArray<string | number> | undefined;
|
||||
// Extensions
|
||||
readonly [key: string]: any;
|
||||
readonly extensions?: { [key: string]: any };
|
||||
}
|
||||
|
||||
2
types/graphql/error/locatedError.d.ts
vendored
2
types/graphql/error/locatedError.d.ts
vendored
@@ -7,7 +7,7 @@ import { ASTNode } from "../language/ast";
|
||||
* document responsible for the original Error.
|
||||
*/
|
||||
export function locatedError(
|
||||
originalError: Error,
|
||||
originalError: Error | GraphQLError,
|
||||
nodes: ReadonlyArray<ASTNode>,
|
||||
path: ReadonlyArray<string | number>
|
||||
): GraphQLError;
|
||||
|
||||
5
types/graphql/execution/execute.d.ts
vendored
5
types/graphql/execution/execute.d.ts
vendored
@@ -121,11 +121,6 @@ export function buildExecutionContext(
|
||||
fieldResolver: Maybe<GraphQLFieldResolver<any, any>>
|
||||
): ReadonlyArray<GraphQLError> | ExecutionContext;
|
||||
|
||||
/**
|
||||
* Extracts the root type of the operation from the schema.
|
||||
*/
|
||||
export function getOperationRootType(schema: GraphQLSchema, operation: OperationDefinitionNode): GraphQLObjectType;
|
||||
|
||||
/**
|
||||
* Given a selectionSet, adds all of the fields in that selection to
|
||||
* the passed in map of fields, and returns it at the end.
|
||||
|
||||
22
types/graphql/index.d.ts
vendored
22
types/graphql/index.d.ts
vendored
@@ -226,9 +226,16 @@ export {
|
||||
EnumTypeDefinitionNode,
|
||||
EnumValueDefinitionNode,
|
||||
InputObjectTypeDefinitionNode,
|
||||
TypeExtensionNode,
|
||||
ObjectTypeExtensionNode,
|
||||
DirectiveDefinitionNode,
|
||||
TypeSystemExtensionNode,
|
||||
SchemaExtensionNode,
|
||||
TypeExtensionNode,
|
||||
ScalarTypeExtensionNode,
|
||||
ObjectTypeExtensionNode,
|
||||
InterfaceTypeExtensionNode,
|
||||
UnionTypeExtensionNode,
|
||||
EnumTypeExtensionNode,
|
||||
InputObjectTypeExtensionNode,
|
||||
KindEnum,
|
||||
TokenKindEnum,
|
||||
DirectiveLocationEnum,
|
||||
@@ -267,7 +274,7 @@ export {
|
||||
NoUnusedVariablesRule,
|
||||
OverlappingFieldsCanBeMergedRule,
|
||||
PossibleFragmentSpreadsRule,
|
||||
ProvidedNonNullArgumentsRule,
|
||||
ProvidedRequiredArgumentsRule,
|
||||
ScalarLeafsRule,
|
||||
SingleFieldSubscriptionsRule,
|
||||
UniqueArgumentNamesRule,
|
||||
@@ -278,7 +285,6 @@ export {
|
||||
UniqueVariableNamesRule,
|
||||
ValuesOfCorrectTypeRule,
|
||||
VariablesAreInputTypesRule,
|
||||
VariablesDefaultValueAllowedRule,
|
||||
VariablesInAllowedPositionRule,
|
||||
} from "./validation";
|
||||
|
||||
@@ -290,10 +296,12 @@ export {
|
||||
// Produce the GraphQL query recommended for a full schema introspection.
|
||||
// Accepts optional IntrospectionOptions.
|
||||
getIntrospectionQuery,
|
||||
// Deprecated: use 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.
|
||||
@@ -329,9 +337,9 @@ export {
|
||||
TypeInfo,
|
||||
// Coerces a JavaScript value to a GraphQL type, or produces errors.
|
||||
coerceValue,
|
||||
// @deprecated use coerceValue
|
||||
// @deprecated use coerceValue - will be removed in v15
|
||||
isValidJSValue,
|
||||
// Determine if AST values adhere to a GraphQL type.
|
||||
// @deprecated use validation - will be removed in v15
|
||||
isValidLiteralValue,
|
||||
// Concatenates multiple AST together.
|
||||
concatAST,
|
||||
|
||||
51
types/graphql/language/ast.d.ts
vendored
51
types/graphql/language/ast.d.ts
vendored
@@ -115,13 +115,14 @@ export type ASTNode =
|
||||
| EnumTypeDefinitionNode
|
||||
| EnumValueDefinitionNode
|
||||
| InputObjectTypeDefinitionNode
|
||||
| DirectiveDefinitionNode
|
||||
| SchemaExtensionNode
|
||||
| ScalarTypeExtensionNode
|
||||
| ObjectTypeExtensionNode
|
||||
| InterfaceTypeExtensionNode
|
||||
| UnionTypeExtensionNode
|
||||
| EnumTypeExtensionNode
|
||||
| InputObjectTypeExtensionNode
|
||||
| DirectiveDefinitionNode;
|
||||
| InputObjectTypeExtensionNode;
|
||||
|
||||
/**
|
||||
* Utility type listing all nodes indexed by their kind.
|
||||
@@ -162,13 +163,14 @@ export interface ASTKindToNode {
|
||||
EnumTypeDefinition: EnumTypeDefinitionNode;
|
||||
EnumValueDefinition: EnumValueDefinitionNode;
|
||||
InputObjectTypeDefinition: InputObjectTypeDefinitionNode;
|
||||
DirectiveDefinition: DirectiveDefinitionNode;
|
||||
SchemaExtension: SchemaExtensionNode;
|
||||
ScalarTypeExtension: ScalarTypeExtensionNode;
|
||||
ObjectTypeExtension: ObjectTypeExtensionNode;
|
||||
InterfaceTypeExtension: InterfaceTypeExtensionNode;
|
||||
UnionTypeExtension: UnionTypeExtensionNode;
|
||||
EnumTypeExtension: EnumTypeExtensionNode;
|
||||
InputObjectTypeExtension: InputObjectTypeExtensionNode;
|
||||
DirectiveDefinition: DirectiveDefinitionNode;
|
||||
}
|
||||
|
||||
// Name
|
||||
@@ -187,7 +189,7 @@ export interface DocumentNode {
|
||||
readonly definitions: ReadonlyArray<DefinitionNode>;
|
||||
}
|
||||
|
||||
export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode; // experimental non-spec addition.
|
||||
export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode | TypeSystemExtensionNode;
|
||||
|
||||
export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode;
|
||||
|
||||
@@ -372,16 +374,12 @@ export interface NonNullTypeNode {
|
||||
|
||||
// Type System Definition
|
||||
|
||||
export type TypeSystemDefinitionNode =
|
||||
| SchemaDefinitionNode
|
||||
| TypeDefinitionNode
|
||||
| TypeExtensionNode
|
||||
| DirectiveDefinitionNode;
|
||||
export type TypeSystemDefinitionNode = SchemaDefinitionNode | TypeDefinitionNode | DirectiveDefinitionNode;
|
||||
|
||||
export interface SchemaDefinitionNode {
|
||||
readonly kind: "SchemaDefinition";
|
||||
readonly loc?: Location;
|
||||
readonly directives: ReadonlyArray<DirectiveNode>;
|
||||
readonly directives?: ReadonlyArray<DirectiveNode>;
|
||||
readonly operationTypes: ReadonlyArray<OperationTypeDefinitionNode>;
|
||||
}
|
||||
|
||||
@@ -484,6 +482,28 @@ export interface InputObjectTypeDefinitionNode {
|
||||
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 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 =
|
||||
@@ -541,14 +561,3 @@ export interface InputObjectTypeExtensionNode {
|
||||
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 locations: ReadonlyArray<NameNode>;
|
||||
}
|
||||
|
||||
11
types/graphql/language/index.d.ts
vendored
11
types/graphql/language/index.d.ts
vendored
@@ -66,9 +66,16 @@ export {
|
||||
EnumTypeDefinitionNode,
|
||||
EnumValueDefinitionNode,
|
||||
InputObjectTypeDefinitionNode,
|
||||
TypeExtensionNode,
|
||||
ObjectTypeExtensionNode,
|
||||
DirectiveDefinitionNode,
|
||||
TypeSystemExtensionNode,
|
||||
SchemaExtensionNode,
|
||||
TypeExtensionNode,
|
||||
ScalarTypeExtensionNode,
|
||||
ObjectTypeExtensionNode,
|
||||
InterfaceTypeExtensionNode,
|
||||
UnionTypeExtensionNode,
|
||||
EnumTypeExtensionNode,
|
||||
InputObjectTypeExtensionNode,
|
||||
} from "./ast";
|
||||
|
||||
export { DirectiveLocation, DirectiveLocationEnum } from "./directiveLocation";
|
||||
|
||||
9
types/graphql/language/kinds.d.ts
vendored
9
types/graphql/language/kinds.d.ts
vendored
@@ -56,6 +56,12 @@ type _Kind = {
|
||||
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";
|
||||
@@ -63,9 +69,6 @@ type _Kind = {
|
||||
UNION_TYPE_EXTENSION: "UnionTypeExtension";
|
||||
ENUM_TYPE_EXTENSION: "EnumTypeExtension";
|
||||
INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension";
|
||||
|
||||
// Directive Definitions
|
||||
DIRECTIVE_DEFINITION: "DirectiveDefinition";
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
4
types/graphql/language/parser.d.ts
vendored
4
types/graphql/language/parser.d.ts
vendored
@@ -19,7 +19,7 @@ export interface ParseOptions {
|
||||
* specification.
|
||||
*
|
||||
* This option is provided to ease adoption of the final SDL specification
|
||||
* and will be removed in a future major release.
|
||||
* and will be removed in v16.
|
||||
*/
|
||||
allowLegacySDLEmptyFields?: boolean;
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface ParseOptions {
|
||||
* current specification.
|
||||
*
|
||||
* This option is provided to ease adoption of the final SDL specification
|
||||
* and will be removed in a future major release.
|
||||
* and will be removed in v16.
|
||||
*/
|
||||
allowLegacySDLImplementsInterfaces?: boolean;
|
||||
|
||||
|
||||
4
types/graphql/language/visitor.d.ts
vendored
4
types/graphql/language/visitor.d.ts
vendored
@@ -33,9 +33,9 @@ export type VisitFn<TAnyNode, TVisitedNode = TAnyNode> = (
|
||||
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 this node.
|
||||
// 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 visited node.
|
||||
// Note: ancestors includes arrays which contain the parent of visited node.
|
||||
ancestors: ReadonlyArray<TAnyNode | ReadonlyArray<TAnyNode>>
|
||||
) => any;
|
||||
|
||||
|
||||
16
types/graphql/type/definition.d.ts
vendored
16
types/graphql/type/definition.d.ts
vendored
@@ -16,6 +16,10 @@ import {
|
||||
FieldNode,
|
||||
FragmentDefinitionNode,
|
||||
ValueNode,
|
||||
ScalarTypeExtensionNode,
|
||||
UnionTypeExtensionNode,
|
||||
EnumTypeExtensionNode,
|
||||
InputObjectTypeExtensionNode,
|
||||
} from "../language/ast";
|
||||
import { GraphQLSchema } from "./schema";
|
||||
|
||||
@@ -256,7 +260,8 @@ export type Thunk<T> = (() => T) | T;
|
||||
export class GraphQLScalarType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode?: Maybe<ScalarTypeDefinitionNode>;
|
||||
astNode: Maybe<ScalarTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
|
||||
constructor(config: GraphQLScalarTypeConfig<any, any>);
|
||||
|
||||
// Serializes an internal value to include in a response.
|
||||
@@ -277,6 +282,7 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
|
||||
name: string;
|
||||
description?: Maybe<string>;
|
||||
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>;
|
||||
@@ -502,7 +508,8 @@ export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
|
||||
export class GraphQLUnionType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode?: Maybe<UnionTypeDefinitionNode>;
|
||||
astNode: Maybe<UnionTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
|
||||
resolveType: Maybe<GraphQLTypeResolver<any, any>>;
|
||||
|
||||
constructor(config: GraphQLUnionTypeConfig<any, any>);
|
||||
@@ -525,6 +532,7 @@ export interface GraphQLUnionTypeConfig<TSource, TContext> {
|
||||
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<UnionTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -552,6 +560,7 @@ export class GraphQLEnumType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode: Maybe<EnumTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
|
||||
|
||||
constructor(config: GraphQLEnumTypeConfig);
|
||||
getValues(): GraphQLEnumValue[];
|
||||
@@ -569,6 +578,7 @@ export interface GraphQLEnumTypeConfig {
|
||||
values: GraphQLEnumValueConfigMap;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<EnumTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
export type GraphQLEnumValueConfigMap = { [key: string]: GraphQLEnumValueConfig };
|
||||
@@ -613,6 +623,7 @@ export class GraphQLInputObjectType {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode: Maybe<InputObjectTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
|
||||
constructor(config: GraphQLInputObjectTypeConfig);
|
||||
getFields(): GraphQLInputFieldMap;
|
||||
toString(): string;
|
||||
@@ -625,6 +636,7 @@ export interface GraphQLInputObjectTypeConfig {
|
||||
fields: Thunk<GraphQLInputFieldConfigMap>;
|
||||
description?: Maybe<string>;
|
||||
astNode?: Maybe<InputObjectTypeDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
|
||||
}
|
||||
|
||||
export interface GraphQLInputFieldConfig {
|
||||
|
||||
4
types/graphql/type/schema.d.ts
vendored
4
types/graphql/type/schema.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import Maybe from "../tsutils/Maybe";
|
||||
import { GraphQLObjectType } from "./definition";
|
||||
import { GraphQLType, GraphQLNamedType, GraphQLAbstractType } from "./definition";
|
||||
import { SchemaDefinitionNode } from "../language/ast";
|
||||
import { SchemaDefinitionNode, SchemaExtensionNode } from "../language/ast";
|
||||
import { GraphQLDirective } from "./directives";
|
||||
|
||||
/**
|
||||
@@ -37,6 +37,7 @@ export function isSchema(schema: any): schema is GraphQLSchema;
|
||||
*/
|
||||
export class GraphQLSchema {
|
||||
astNode: Maybe<SchemaDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<SchemaExtensionNode>>;
|
||||
|
||||
constructor(config: GraphQLSchemaConfig);
|
||||
|
||||
@@ -83,4 +84,5 @@ export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {
|
||||
types?: Maybe<GraphQLNamedType[]>;
|
||||
directives?: Maybe<GraphQLDirective[]>;
|
||||
astNode?: Maybe<SchemaDefinitionNode>;
|
||||
extensionASTNodes?: Maybe<ReadonlyArray<SchemaExtensionNode>>;
|
||||
}
|
||||
|
||||
8
types/graphql/utilities/buildASTSchema.d.ts
vendored
8
types/graphql/utilities/buildASTSchema.d.ts
vendored
@@ -7,8 +7,10 @@ import {
|
||||
NamedTypeNode,
|
||||
DirectiveDefinitionNode,
|
||||
FieldDefinitionNode,
|
||||
InputValueDefinitionNode,
|
||||
EnumValueDefinitionNode,
|
||||
} from "../language/ast";
|
||||
import { GraphQLNamedType, GraphQLFieldConfig } from "../type/definition";
|
||||
import { GraphQLNamedType, GraphQLFieldConfig, GraphQLInputField, GraphQLEnumValueConfig } from "../type/definition";
|
||||
import { GraphQLDirective } from "../type/directives";
|
||||
import { Source } from "../language/source";
|
||||
import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema";
|
||||
@@ -57,6 +59,10 @@ export class ASTDefinitionBuilder {
|
||||
buildDirective(directiveNode: DirectiveDefinitionNode): GraphQLDirective;
|
||||
|
||||
buildField(field: FieldDefinitionNode): GraphQLFieldConfig<any, any>;
|
||||
|
||||
buildInputField(value: InputValueDefinitionNode): GraphQLInputField;
|
||||
|
||||
buildEnumValue(value: EnumValueDefinitionNode): GraphQLEnumValueConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
11
types/graphql/utilities/getOperationRootType.d.ts
vendored
Normal file
11
types/graphql/utilities/getOperationRootType.d.ts
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;
|
||||
9
types/graphql/utilities/index.d.ts
vendored
9
types/graphql/utilities/index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
// The GraphQL query recommended for a full schema introspection.
|
||||
export {
|
||||
getIntrospectionQuery,
|
||||
// Deprecated, use getIntrospectionQuery()
|
||||
// @deprecated, use getIntrospectionQuery() - will be removed in v15
|
||||
introspectionQuery,
|
||||
} from "./introspectionQuery";
|
||||
|
||||
@@ -33,6 +33,9 @@ export {
|
||||
// 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";
|
||||
|
||||
@@ -70,10 +73,10 @@ export { TypeInfo } from "./TypeInfo";
|
||||
// Coerces a JavaScript value to a GraphQL type, or produces errors.
|
||||
export { coerceValue } from "./coerceValue";
|
||||
|
||||
// @deprecated use coerceValue
|
||||
// @deprecated use coerceValue - will be removed in v15
|
||||
export { isValidJSValue } from "./isValidJSValue";
|
||||
|
||||
// Determine if AST values adhere to a GraphQL type.
|
||||
// @deprecated use validation - will be removed in v15
|
||||
export { isValidLiteralValue } from "./isValidLiteralValue";
|
||||
|
||||
// Concatenates multiple AST together.
|
||||
|
||||
@@ -9,6 +9,11 @@ export interface IntrospectionOptions {
|
||||
|
||||
export function getIntrospectionQuery(options?: IntrospectionOptions): string;
|
||||
|
||||
/**
|
||||
* Deprecated, call getIntrospectionQuery directly.
|
||||
*
|
||||
* This function will be removed in v15
|
||||
*/
|
||||
export const introspectionQuery: string;
|
||||
|
||||
export interface IntrospectionQuery {
|
||||
|
||||
2
types/graphql/utilities/isValidJSValue.d.ts
vendored
2
types/graphql/utilities/isValidJSValue.d.ts
vendored
@@ -2,5 +2,7 @@ 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[];
|
||||
|
||||
@@ -6,5 +6,7 @@ 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>;
|
||||
|
||||
5
types/graphql/validation/index.d.ts
vendored
5
types/graphql/validation/index.d.ts
vendored
@@ -45,7 +45,7 @@ export { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from
|
||||
export { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreads";
|
||||
|
||||
// Spec Section: "Argument Optionality"
|
||||
export { ProvidedNonNullArguments as ProvidedNonNullArgumentsRule } from "./rules/ProvidedNonNullArguments";
|
||||
export { ProvidedRequiredArguments as ProvidedRequiredArgumentsRule } from "./rules/ProvidedRequiredArguments";
|
||||
|
||||
// Spec Section: "Leaf Field Selections"
|
||||
export { ScalarLeafs as ScalarLeafsRule } from "./rules/ScalarLeafs";
|
||||
@@ -77,8 +77,5 @@ export { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from "./rules/ValuesOf
|
||||
// Spec Section: "Variables are Input Types"
|
||||
export { VariablesAreInputTypes as VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypes";
|
||||
|
||||
// Spec Section: "Variables Default Value Is Allowed"
|
||||
export { VariablesDefaultValueAllowed as VariablesDefaultValueAllowedRule } from "./rules/VariablesDefaultValueAllowed";
|
||||
|
||||
// Spec Section: "All Variable Usages Are Allowed"
|
||||
export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPosition";
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
import { GraphQLType } from "../../type/definition";
|
||||
|
||||
export function inlineFragmentOnNonCompositeErrorMessage(type: GraphQLType): string;
|
||||
export function inlineFragmentOnNonCompositeErrorMessage(type: string): string;
|
||||
|
||||
export function fragmentOnNonCompositeErrorMessage(fragName: string, type: GraphQLType): string;
|
||||
export function fragmentOnNonCompositeErrorMessage(fragName: string, type: string): string;
|
||||
|
||||
/**
|
||||
* Fragments on composite type
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
import { GraphQLType } from "../../type/definition";
|
||||
|
||||
export function typeIncompatibleSpreadMessage(fragName: string, parentType: GraphQLType, fragType: GraphQLType): string;
|
||||
export function typeIncompatibleSpreadMessage(fragName: string, parentType: string, fragType: string): string;
|
||||
|
||||
export function typeIncompatibleAnonSpreadMessage(parentType: GraphQLType, fragType: GraphQLType): string;
|
||||
export function typeIncompatibleAnonSpreadMessage(parentType: string, fragType: string): string;
|
||||
|
||||
/**
|
||||
* Possible fragment spread
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
import { GraphQLType } from "../../type/definition";
|
||||
|
||||
export function missingFieldArgMessage(fieldName: string, argName: string, type: GraphQLType): string;
|
||||
|
||||
export function missingDirectiveArgMessage(directiveName: string, argName: string, type: GraphQLType): string;
|
||||
|
||||
/**
|
||||
* Provided required arguments
|
||||
*
|
||||
* A field or directive is only valid if all required (non-null) field arguments
|
||||
* have been provided.
|
||||
*/
|
||||
export function ProvidedNonNullArguments(context: ValidationContext): ASTVisitor;
|
||||
14
types/graphql/validation/rules/ProvidedRequiredArguments.d.ts
vendored
Normal file
14
types/graphql/validation/rules/ProvidedRequiredArguments.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import ValidationContext 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;
|
||||
@@ -1,10 +1,9 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
import { GraphQLType } from "../../type/definition";
|
||||
|
||||
export function noSubselectionAllowedMessage(fieldName: string, type: GraphQLType): string;
|
||||
export function noSubselectionAllowedMessage(fieldName: string, type: string): string;
|
||||
|
||||
export function requiredSubselectionMessage(fieldName: string, type: GraphQLType): string;
|
||||
export function requiredSubselectionMessage(fieldName: string, type: string): string;
|
||||
|
||||
/**
|
||||
* Scalar leafs
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
import { GraphQLType } from "../../type/definition";
|
||||
|
||||
export function defaultForRequiredVarMessage(varName: string, type: GraphQLType, guessType: GraphQLType): string;
|
||||
|
||||
/**
|
||||
* Variable's default value is allowed
|
||||
*
|
||||
* A GraphQL document is only valid if all variable default values are allowed
|
||||
* due to a variable not being required.
|
||||
*/
|
||||
export function VariablesDefaultValueAllowed(context: ValidationContext): ASTVisitor;
|
||||
@@ -1,8 +1,7 @@
|
||||
import ValidationContext from "../ValidationContext";
|
||||
import { ASTVisitor } from "../../language/visitor";
|
||||
import { GraphQLType } from "../../type/definition";
|
||||
|
||||
export function badVarPosMessage(varName: string, varType: GraphQLType, expectedType: GraphQLType): string;
|
||||
export function badVarPosMessage(varName: string, varType: string, expectedType: string): string;
|
||||
|
||||
/**
|
||||
* Variables passed to field arguments conform to type
|
||||
|
||||
5
types/graphql/validation/specifiedRules.d.ts
vendored
5
types/graphql/validation/specifiedRules.d.ts
vendored
@@ -65,10 +65,7 @@ import { UniqueArgumentNames } from "./rules/UniqueArgumentNames";
|
||||
import { ValuesOfCorrectType } from "./rules/ValuesOfCorrectType";
|
||||
|
||||
// Spec Section: "Argument Optionality"
|
||||
import { ProvidedNonNullArguments } from "./rules/ProvidedNonNullArguments";
|
||||
|
||||
// Spec Section: "Variables Default Value Is Allowed"
|
||||
import { VariablesDefaultValueAllowed } from "./rules/VariablesDefaultValueAllowed";
|
||||
import { ProvidedRequiredArguments } from "./rules/ProvidedRequiredArguments";
|
||||
|
||||
// Spec Section: "All Variable Usages Are Allowed"
|
||||
import { VariablesInAllowedPosition } from "./rules/VariablesInAllowedPosition";
|
||||
|
||||
Reference in New Issue
Block a user