@types/graphql
Advanced tools
Comparing version 0.12.6 to 0.12.7
@@ -1,2 +0,2 @@ | ||
import { GraphQLError } from './GraphQLError'; | ||
import { GraphQLError } from "./GraphQLError"; | ||
@@ -10,10 +10,10 @@ /** | ||
export interface GraphQLFormattedError { | ||
message: string; | ||
locations?: GraphQLErrorLocation[]; | ||
path?: Array<string | number>; | ||
message: string; | ||
locations?: GraphQLErrorLocation[]; | ||
path?: Array<string | number>; | ||
} | ||
export interface GraphQLErrorLocation { | ||
line: number; | ||
column: number; | ||
line: number; | ||
column: number; | ||
} |
@@ -1,4 +0,4 @@ | ||
import { getLocation } from '../language'; | ||
import { ASTNode } from '../language/ast'; | ||
import { Source } from '../language/source'; | ||
import { getLocation } from "../language"; | ||
import { ASTNode } from "../language/ast"; | ||
import { Source } from "../language/source"; | ||
@@ -12,64 +12,64 @@ /** | ||
export class GraphQLError extends Error { | ||
/** | ||
* A message describing the Error for debugging purposes. | ||
* | ||
* Enumerable, and appears in the result of JSON.stringify(). | ||
*/ | ||
message: string; | ||
/** | ||
* A message describing the Error for debugging purposes. | ||
* | ||
* Enumerable, and appears in the result of JSON.stringify(). | ||
*/ | ||
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(). | ||
*/ | ||
locations?: Array<{ line: number; column: number }> | undefined; | ||
/** | ||
* 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(). | ||
*/ | ||
locations?: Array<{ line: number; column: number }> | 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(). | ||
*/ | ||
path?: Array<string | number> | 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(). | ||
*/ | ||
path?: Array<string | number> | undefined; | ||
/** | ||
* An array of GraphQL AST Nodes corresponding to this error. | ||
*/ | ||
nodes?: ASTNode[] | undefined; | ||
/** | ||
* An array of GraphQL AST Nodes corresponding to this error. | ||
*/ | ||
nodes?: ASTNode[] | undefined; | ||
/** | ||
* The source GraphQL document corresponding to this error. | ||
*/ | ||
source?: Source | undefined; | ||
/** | ||
* The source GraphQL document corresponding to this error. | ||
*/ | ||
source?: Source | undefined; | ||
/** | ||
* An array of character offsets within the source GraphQL document | ||
* which correspond to this error. | ||
*/ | ||
positions?: number[] | undefined; | ||
/** | ||
* An array of character offsets within the source GraphQL document | ||
* which correspond to this error. | ||
*/ | ||
positions?: number[] | undefined; | ||
/** | ||
* The original error thrown from a field resolver during execution. | ||
*/ | ||
originalError?: Error; | ||
/** | ||
* Extension fields to add to the formatted error. | ||
*/ | ||
extensions?: { [key: string]: any } | undefined; | ||
/** | ||
* The original error thrown from a field resolver during execution. | ||
*/ | ||
originalError?: Error; | ||
constructor( | ||
message: string, | ||
nodes?: any[], | ||
source?: Source, | ||
positions?: number[], | ||
path?: Array<string | number>, | ||
originalError?: Error, | ||
extensions?: { [key: string]: any }, | ||
); | ||
/** | ||
* Extension fields to add to the formatted error. | ||
*/ | ||
extensions?: { [key: string]: any } | undefined; | ||
constructor( | ||
message: string, | ||
nodes?: any[], | ||
source?: Source, | ||
positions?: number[], | ||
path?: Array<string | number>, | ||
originalError?: Error, | ||
extensions?: { [key: string]: any } | ||
); | ||
} |
@@ -1,8 +0,4 @@ | ||
export { GraphQLError } from './GraphQLError'; | ||
export { syntaxError } from './syntaxError'; | ||
export { locatedError } from './locatedError'; | ||
export { | ||
formatError, | ||
GraphQLFormattedError, | ||
GraphQLErrorLocation, | ||
} from './formatError'; | ||
export { GraphQLError } from "./GraphQLError"; | ||
export { syntaxError } from "./syntaxError"; | ||
export { locatedError } from "./locatedError"; | ||
export { formatError, GraphQLFormattedError, GraphQLErrorLocation } from "./formatError"; |
@@ -1,2 +0,2 @@ | ||
import { GraphQLError } from './GraphQLError'; | ||
import { GraphQLError } from "./GraphQLError"; | ||
@@ -8,6 +8,2 @@ /** | ||
*/ | ||
export function locatedError<T>( | ||
originalError: Error, | ||
nodes: T[], | ||
path: Array<string | number>, | ||
): GraphQLError; | ||
export function locatedError<T>(originalError: Error, nodes: T[], path: Array<string | number>): GraphQLError; |
@@ -1,3 +0,3 @@ | ||
import { Source } from '../language/source'; | ||
import { GraphQLError } from './GraphQLError'; | ||
import { Source } from "../language/source"; | ||
import { GraphQLError } from "./GraphQLError"; | ||
@@ -8,6 +8,2 @@ /** | ||
*/ | ||
export function syntaxError( | ||
source: Source, | ||
position: number, | ||
description: string, | ||
): GraphQLError; | ||
export function syntaxError(source: Source, position: number, description: string): GraphQLError; |
@@ -1,17 +0,13 @@ | ||
import { GraphQLError, locatedError } from '../error'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { GraphQLError, locatedError } from "../error"; | ||
import { GraphQLSchema } from "../type/schema"; | ||
import { GraphQLField, GraphQLFieldResolver, ResponsePath } from "../type/definition"; | ||
import { | ||
GraphQLField, | ||
GraphQLFieldResolver, | ||
ResponsePath, | ||
} from '../type/definition'; | ||
import { | ||
DirectiveNode, | ||
DocumentNode, | ||
OperationDefinitionNode, | ||
SelectionSetNode, | ||
FieldNode, | ||
InlineFragmentNode, | ||
FragmentDefinitionNode, | ||
} from '../language/ast'; | ||
DirectiveNode, | ||
DocumentNode, | ||
OperationDefinitionNode, | ||
SelectionSetNode, | ||
FieldNode, | ||
InlineFragmentNode, | ||
FragmentDefinitionNode, | ||
} from "../language/ast"; | ||
/** | ||
@@ -24,9 +20,9 @@ * Data that must be available at all points during query execution. | ||
export interface ExecutionContext { | ||
schema: GraphQLSchema; | ||
fragments: { [key: string]: FragmentDefinitionNode }; | ||
rootValue: any; | ||
operation: OperationDefinitionNode; | ||
variableValues: { [key: string]: any }; | ||
fieldResolver: GraphQLFieldResolver<any, any>; | ||
errors: GraphQLError[]; | ||
schema: GraphQLSchema; | ||
fragments: { [key: string]: FragmentDefinitionNode }; | ||
rootValue: any; | ||
operation: OperationDefinitionNode; | ||
variableValues: { [key: string]: any }; | ||
fieldResolver: GraphQLFieldResolver<any, any>; | ||
errors: GraphQLError[]; | ||
} | ||
@@ -41,15 +37,15 @@ | ||
export interface ExecutionResult { | ||
data?: { [key: string]: any }; | ||
extensions?: { [key: string]: any }; | ||
errors?: GraphQLError[]; | ||
data?: { [key: string]: any }; | ||
extensions?: { [key: string]: any }; | ||
errors?: GraphQLError[]; | ||
} | ||
export type ExecutionArgs = { | ||
schema: GraphQLSchema; | ||
document: DocumentNode; | ||
rootValue?: any; | ||
contextValue?: any; | ||
variableValues?: { [key: string]: any }; | ||
operationName?: string; | ||
fieldResolver?: GraphQLFieldResolver<any, any>; | ||
schema: GraphQLSchema; | ||
document: DocumentNode; | ||
rootValue?: any; | ||
contextValue?: any; | ||
variableValues?: { [key: string]: any }; | ||
operationName?: string; | ||
fieldResolver?: GraphQLFieldResolver<any, any>; | ||
}; | ||
@@ -69,11 +65,11 @@ | ||
export function execute( | ||
schema: GraphQLSchema, | ||
document: DocumentNode, | ||
rootValue?: any, | ||
contextValue?: any, | ||
variableValues?: { | ||
[key: string]: any; | ||
}, | ||
operationName?: string, | ||
fieldResolver?: GraphQLFieldResolver<any, any>, | ||
schema: GraphQLSchema, | ||
document: DocumentNode, | ||
rootValue?: any, | ||
contextValue?: any, | ||
variableValues?: { | ||
[key: string]: any; | ||
}, | ||
operationName?: string, | ||
fieldResolver?: GraphQLFieldResolver<any, any> | ||
): Promise<ExecutionResult>; | ||
@@ -80,0 +76,0 @@ |
@@ -1,9 +0,3 @@ | ||
export { | ||
execute, | ||
defaultFieldResolver, | ||
responsePathAsArray, | ||
ExecutionArgs, | ||
ExecutionResult, | ||
} from './execute'; | ||
export { execute, defaultFieldResolver, responsePathAsArray, ExecutionArgs, ExecutionResult } from "./execute"; | ||
export { getDirectiveValues } from './values'; | ||
export { getDirectiveValues } from "./values"; |
@@ -1,13 +0,5 @@ | ||
import { | ||
GraphQLInputType, | ||
GraphQLField, | ||
GraphQLArgument, | ||
} from '../type/definition'; | ||
import { GraphQLDirective } from '../type/directives'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { | ||
FieldNode, | ||
DirectiveNode, | ||
VariableDefinitionNode, | ||
} from '../language/ast'; | ||
import { GraphQLInputType, GraphQLField, GraphQLArgument } from "../type/definition"; | ||
import { GraphQLDirective } from "../type/directives"; | ||
import { GraphQLSchema } from "../type/schema"; | ||
import { FieldNode, DirectiveNode, VariableDefinitionNode } from "../language/ast"; | ||
@@ -20,5 +12,5 @@ /** | ||
export function getVariableValues( | ||
schema: GraphQLSchema, | ||
varDefNodes: VariableDefinitionNode[], | ||
inputs: { [key: string]: any }, | ||
schema: GraphQLSchema, | ||
varDefNodes: VariableDefinitionNode[], | ||
inputs: { [key: string]: any } | ||
): { [key: string]: any }; | ||
@@ -31,5 +23,5 @@ | ||
export function getArgumentValues( | ||
def: GraphQLField<any, any> | GraphQLDirective, | ||
node: FieldNode | DirectiveNode, | ||
variableValues?: { [key: string]: any }, | ||
def: GraphQLField<any, any> | GraphQLDirective, | ||
node: FieldNode | DirectiveNode, | ||
variableValues?: { [key: string]: any } | ||
): { [key: string]: any }; | ||
@@ -45,5 +37,5 @@ | ||
export function getDirectiveValues( | ||
directiveDef: GraphQLDirective, | ||
node: { directives?: Array<DirectiveNode> }, | ||
variableValues?: { [key: string]: any }, | ||
directiveDef: GraphQLDirective, | ||
node: { directives?: Array<DirectiveNode> }, | ||
variableValues?: { [key: string]: any } | ||
): void | { [key: string]: any }; |
@@ -1,5 +0,5 @@ | ||
import { Source } from './language/source'; | ||
import { GraphQLFieldResolver } from './type/definition'; | ||
import { GraphQLSchema } from './type/schema'; | ||
import { ExecutionResult } from './execution/execute'; | ||
import { Source } from "./language/source"; | ||
import { GraphQLFieldResolver } from "./type/definition"; | ||
import { GraphQLSchema } from "./type/schema"; | ||
import { ExecutionResult } from "./execution/execute"; | ||
@@ -37,11 +37,11 @@ /** | ||
export function graphql(args: { | ||
schema: GraphQLSchema, | ||
source: string | Source, | ||
rootValue?: any, | ||
contextValue?: any, | ||
schema: GraphQLSchema; | ||
source: string | Source; | ||
rootValue?: any; | ||
contextValue?: any; | ||
variableValues?: { | ||
[key: string]: any | ||
}, | ||
operationName?: string, | ||
fieldResolver?: GraphQLFieldResolver<any, any> | ||
[key: string]: any; | ||
}; | ||
operationName?: string; | ||
fieldResolver?: GraphQLFieldResolver<any, any>; | ||
}): Promise<ExecutionResult>; | ||
@@ -54,3 +54,3 @@ export function graphql( | ||
variableValues?: { | ||
[key: string]: any | ||
[key: string]: any; | ||
}, | ||
@@ -57,0 +57,0 @@ operationName?: string, |
@@ -20,13 +20,11 @@ // Type definitions for graphql 0.12 | ||
// The primary entry point into fulfilling a GraphQL request. | ||
export { | ||
graphql | ||
} from './graphql'; | ||
export { graphql } from "./graphql"; | ||
// Create and operate on GraphQL type definitions and schema. | ||
export * from './type'; | ||
export * from "./type"; | ||
// Parse and operate on GraphQL language source files. | ||
export * from './language'; | ||
export * from "./language"; | ||
export * from './subscription'; | ||
export * from "./subscription"; | ||
@@ -41,3 +39,3 @@ // Execute GraphQL queries. | ||
ExecutionResult, | ||
} from './execution'; | ||
} from "./execution"; | ||
@@ -48,6 +46,4 @@ // Validate GraphQL queries. | ||
ValidationContext, | ||
// All validation rules in the GraphQL Specification. | ||
specifiedRules, | ||
// Individual validation rules. | ||
@@ -80,11 +76,6 @@ ArgumentsOfCorrectTypeRule, | ||
VariablesInAllowedPositionRule, | ||
} from './validation'; | ||
} from "./validation"; | ||
// Create and format GraphQL errors. | ||
export { | ||
GraphQLError, | ||
formatError, | ||
GraphQLFormattedError, | ||
GraphQLErrorLocation, | ||
} from './error'; | ||
export { GraphQLError, formatError, GraphQLFormattedError, GraphQLErrorLocation } from "./error"; | ||
@@ -95,53 +86,36 @@ // Utilities for operating on GraphQL type schema and parsed sources. | ||
introspectionQuery, | ||
// Gets the target Operation from a Document | ||
getOperationAST, | ||
// 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, | ||
// Get the description of an AST node | ||
getDescription, | ||
// Extends an existing GraphQLSchema from a parsed GraphQL Schema | ||
// language AST. | ||
extendSchema, | ||
// Print a GraphQLSchema to GraphQL Schema language. | ||
printSchema, | ||
// 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. | ||
valueFromAST, | ||
// 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, | ||
// Determine if JavaScript values adhere to a GraphQL type. | ||
isValidJSValue, | ||
// Determine if AST values adhere to a GraphQL type. | ||
isValidLiteralValue, | ||
// Concatenates multiple AST together. | ||
concatAST, | ||
// Separates an AST into an AST per Operation. | ||
separateOperations, | ||
// Comparators for types | ||
@@ -151,14 +125,9 @@ isEqualType, | ||
doTypesOverlap, | ||
// Asserts a string is a valid GraphQL name. | ||
assertValidName, | ||
// Compares two GraphQLSchemas and detects breaking changes. | ||
findBreakingChanges, | ||
// Report all deprecated usage within a GraphQL document. | ||
findDeprecatedUsages, | ||
BreakingChange, | ||
IntrospectionDirective, | ||
@@ -181,2 +150,2 @@ IntrospectionEnumType, | ||
IntrospectionUnionType, | ||
} from './utilities'; | ||
} from "./utilities"; |
@@ -1,2 +0,2 @@ | ||
import { Source } from './source'; | ||
import { Source } from "./source"; | ||
@@ -8,26 +8,26 @@ /** | ||
export interface Location { | ||
/** | ||
* The character offset at which this Node begins. | ||
*/ | ||
start: number; | ||
/** | ||
* The character offset at which this Node begins. | ||
*/ | ||
start: number; | ||
/** | ||
* The character offset at which this Node ends. | ||
*/ | ||
end: number; | ||
/** | ||
* The character offset at which this Node ends. | ||
*/ | ||
end: number; | ||
/** | ||
* The Token at which this Node begins. | ||
*/ | ||
startToken: Token; | ||
/** | ||
* The Token at which this Node begins. | ||
*/ | ||
startToken: Token; | ||
/** | ||
* The Token at which this Node ends. | ||
*/ | ||
endToken: Token; | ||
/** | ||
* The Token at which this Node ends. | ||
*/ | ||
endToken: Token; | ||
/** | ||
* The Source document the AST represents. | ||
*/ | ||
source: Source; | ||
/** | ||
* The Source document the AST represents. | ||
*/ | ||
source: Source; | ||
} | ||
@@ -41,23 +41,23 @@ | ||
type TokenKind = | ||
| '<SOF>' | ||
| '<EOF>' | ||
| '!' | ||
| '$' | ||
| '(' | ||
| ')' | ||
| '...' | ||
| ':' | ||
| '=' | ||
| '@' | ||
| '[' | ||
| ']' | ||
| '{' | ||
| '|' | ||
| '}' | ||
| 'Name' | ||
| 'Int' | ||
| 'Float' | ||
| 'String' | ||
| 'BlockString' | ||
| 'Comment'; | ||
| "<SOF>" | ||
| "<EOF>" | ||
| "!" | ||
| "$" | ||
| "(" | ||
| ")" | ||
| "..." | ||
| ":" | ||
| "=" | ||
| "@" | ||
| "[" | ||
| "]" | ||
| "{" | ||
| "|" | ||
| "}" | ||
| "Name" | ||
| "Int" | ||
| "Float" | ||
| "String" | ||
| "BlockString" | ||
| "Comment"; | ||
@@ -69,39 +69,39 @@ /** | ||
export interface Token { | ||
/** | ||
* The kind of Token. | ||
*/ | ||
kind: TokenKind; | ||
/** | ||
* The kind of Token. | ||
*/ | ||
kind: TokenKind; | ||
/** | ||
* The character offset at which this Node begins. | ||
*/ | ||
start: number; | ||
/** | ||
* The character offset at which this Node begins. | ||
*/ | ||
start: number; | ||
/** | ||
* The character offset at which this Node ends. | ||
*/ | ||
end: number; | ||
/** | ||
* The character offset at which this Node ends. | ||
*/ | ||
end: number; | ||
/** | ||
* The 1-indexed line number on which this Token appears. | ||
*/ | ||
line: number; | ||
/** | ||
* The 1-indexed line number on which this Token appears. | ||
*/ | ||
line: number; | ||
/** | ||
* The 1-indexed column number at which this Token begins. | ||
*/ | ||
column: number; | ||
/** | ||
* The 1-indexed column number at which this Token begins. | ||
*/ | ||
column: number; | ||
/** | ||
* For non-punctuation tokens, represents the interpreted value of the token. | ||
*/ | ||
value: string | undefined; | ||
/** | ||
* For non-punctuation tokens, represents the interpreted value of the token. | ||
*/ | ||
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. | ||
*/ | ||
prev?: Token; | ||
next?: Token; | ||
/** | ||
* 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. | ||
*/ | ||
prev?: Token; | ||
next?: Token; | ||
} | ||
@@ -113,44 +113,44 @@ | ||
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 | ||
| ScalarTypeExtensionNode | ||
| ObjectTypeExtensionNode | ||
| InterfaceTypeExtensionNode | ||
| UnionTypeExtensionNode | ||
| EnumTypeExtensionNode | ||
| InputObjectTypeExtensionNode | ||
| DirectiveDefinitionNode; | ||
| 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 | ||
| ScalarTypeExtensionNode | ||
| ObjectTypeExtensionNode | ||
| InterfaceTypeExtensionNode | ||
| UnionTypeExtensionNode | ||
| EnumTypeExtensionNode | ||
| InputObjectTypeExtensionNode | ||
| DirectiveDefinitionNode; | ||
@@ -161,44 +161,44 @@ /** | ||
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; | ||
ScalarTypeExtension: ScalarTypeExtensionNode; | ||
ObjectTypeExtension: ObjectTypeExtensionNode; | ||
InterfaceTypeExtension: InterfaceTypeExtensionNode; | ||
UnionTypeExtension: UnionTypeExtensionNode; | ||
EnumTypeExtension: EnumTypeExtensionNode; | ||
InputObjectTypeExtension: InputObjectTypeExtensionNode; | ||
DirectiveDefinition: DirectiveDefinitionNode; | ||
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; | ||
ScalarTypeExtension: ScalarTypeExtensionNode; | ||
ObjectTypeExtension: ObjectTypeExtensionNode; | ||
InterfaceTypeExtension: InterfaceTypeExtensionNode; | ||
UnionTypeExtension: UnionTypeExtensionNode; | ||
EnumTypeExtension: EnumTypeExtensionNode; | ||
InputObjectTypeExtension: InputObjectTypeExtensionNode; | ||
DirectiveDefinition: DirectiveDefinitionNode; | ||
} | ||
@@ -209,5 +209,5 @@ | ||
export interface NameNode { | ||
kind: 'Name'; | ||
loc?: Location; | ||
value: string; | ||
kind: "Name"; | ||
loc?: Location; | ||
value: string; | ||
} | ||
@@ -218,46 +218,42 @@ | ||
export interface DocumentNode { | ||
kind: 'Document'; | ||
loc?: Location; | ||
definitions: DefinitionNode[]; | ||
kind: "Document"; | ||
loc?: Location; | ||
definitions: DefinitionNode[]; | ||
} | ||
export type DefinitionNode = | ||
| ExecutableDefinitionNode | ||
| TypeSystemDefinitionNode; // experimental non-spec addition. | ||
export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode; // experimental non-spec addition. | ||
export type ExecutableDefinitionNode = | ||
| OperationDefinitionNode | ||
| FragmentDefinitionNode; | ||
export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode; | ||
export interface OperationDefinitionNode { | ||
kind: 'OperationDefinition'; | ||
loc?: Location; | ||
operation: OperationTypeNode; | ||
name?: NameNode; | ||
variableDefinitions?: VariableDefinitionNode[]; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
kind: "OperationDefinition"; | ||
loc?: Location; | ||
operation: OperationTypeNode; | ||
name?: NameNode; | ||
variableDefinitions?: VariableDefinitionNode[]; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
} | ||
// Note: subscription is an experimental non-spec addition. | ||
export type OperationTypeNode = 'query' | 'mutation' | 'subscription'; | ||
export type OperationTypeNode = "query" | "mutation" | "subscription"; | ||
export interface VariableDefinitionNode { | ||
kind: 'VariableDefinition'; | ||
loc?: Location; | ||
variable: VariableNode; | ||
type: TypeNode; | ||
defaultValue?: ValueNode; | ||
kind: "VariableDefinition"; | ||
loc?: Location; | ||
variable: VariableNode; | ||
type: TypeNode; | ||
defaultValue?: ValueNode; | ||
} | ||
export interface VariableNode { | ||
kind: 'Variable'; | ||
loc?: Location; | ||
name: NameNode; | ||
kind: "Variable"; | ||
loc?: Location; | ||
name: NameNode; | ||
} | ||
export interface SelectionSetNode { | ||
kind: 'SelectionSet'; | ||
loc?: Location; | ||
selections: SelectionNode[]; | ||
kind: "SelectionSet"; | ||
loc?: Location; | ||
selections: SelectionNode[]; | ||
} | ||
@@ -268,16 +264,16 @@ | ||
export interface FieldNode { | ||
kind: 'Field'; | ||
loc?: Location; | ||
alias?: NameNode; | ||
name: NameNode; | ||
arguments?: ArgumentNode[]; | ||
directives?: DirectiveNode[]; | ||
selectionSet?: SelectionSetNode; | ||
kind: "Field"; | ||
loc?: Location; | ||
alias?: NameNode; | ||
name: NameNode; | ||
arguments?: ArgumentNode[]; | ||
directives?: DirectiveNode[]; | ||
selectionSet?: SelectionSetNode; | ||
} | ||
export interface ArgumentNode { | ||
kind: 'Argument'; | ||
loc?: Location; | ||
name: NameNode; | ||
value: ValueNode; | ||
kind: "Argument"; | ||
loc?: Location; | ||
name: NameNode; | ||
value: ValueNode; | ||
} | ||
@@ -288,26 +284,26 @@ | ||
export interface FragmentSpreadNode { | ||
kind: 'FragmentSpread'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
kind: "FragmentSpread"; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
} | ||
export interface InlineFragmentNode { | ||
kind: 'InlineFragment'; | ||
loc?: Location; | ||
typeCondition?: NamedTypeNode; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
kind: "InlineFragment"; | ||
loc?: Location; | ||
typeCondition?: NamedTypeNode; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
} | ||
export interface FragmentDefinitionNode { | ||
kind: 'FragmentDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
// Note: fragment variable definitions are experimental and may be changed | ||
// or removed in the future. | ||
variableDefinitions?: VariableDefinitionNode[]; | ||
typeCondition: NamedTypeNode; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
kind: "FragmentDefinition"; | ||
loc?: Location; | ||
name: NameNode; | ||
// Note: fragment variable definitions are experimental and may be changed | ||
// or removed in the future. | ||
variableDefinitions?: VariableDefinitionNode[]; | ||
typeCondition: NamedTypeNode; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
} | ||
@@ -318,64 +314,64 @@ | ||
export type ValueNode = | ||
| VariableNode | ||
| IntValueNode | ||
| FloatValueNode | ||
| StringValueNode | ||
| BooleanValueNode | ||
| NullValueNode | ||
| EnumValueNode | ||
| ListValueNode | ||
| ObjectValueNode; | ||
| VariableNode | ||
| IntValueNode | ||
| FloatValueNode | ||
| StringValueNode | ||
| BooleanValueNode | ||
| NullValueNode | ||
| EnumValueNode | ||
| ListValueNode | ||
| ObjectValueNode; | ||
export interface IntValueNode { | ||
kind: 'IntValue'; | ||
loc?: Location; | ||
value: string; | ||
kind: "IntValue"; | ||
loc?: Location; | ||
value: string; | ||
} | ||
export interface FloatValueNode { | ||
kind: 'FloatValue'; | ||
loc?: Location; | ||
value: string; | ||
kind: "FloatValue"; | ||
loc?: Location; | ||
value: string; | ||
} | ||
export interface StringValueNode { | ||
kind: 'StringValue'; | ||
loc?: Location; | ||
value: string; | ||
kind: "StringValue"; | ||
loc?: Location; | ||
value: string; | ||
} | ||
export interface BooleanValueNode { | ||
kind: 'BooleanValue'; | ||
loc?: Location; | ||
value: boolean; | ||
kind: "BooleanValue"; | ||
loc?: Location; | ||
value: boolean; | ||
} | ||
export interface NullValueNode { | ||
kind: 'NullValue'; | ||
loc?: Location; | ||
kind: "NullValue"; | ||
loc?: Location; | ||
} | ||
export interface EnumValueNode { | ||
kind: 'EnumValue'; | ||
loc?: Location; | ||
value: string; | ||
kind: "EnumValue"; | ||
loc?: Location; | ||
value: string; | ||
} | ||
export interface ListValueNode { | ||
kind: 'ListValue'; | ||
loc?: Location; | ||
values: ValueNode[]; | ||
kind: "ListValue"; | ||
loc?: Location; | ||
values: ValueNode[]; | ||
} | ||
export interface ObjectValueNode { | ||
kind: 'ObjectValue'; | ||
loc?: Location; | ||
fields: ObjectFieldNode[]; | ||
kind: "ObjectValue"; | ||
loc?: Location; | ||
fields: ObjectFieldNode[]; | ||
} | ||
export interface ObjectFieldNode { | ||
kind: 'ObjectField'; | ||
loc?: Location; | ||
name: NameNode; | ||
value: ValueNode; | ||
kind: "ObjectField"; | ||
loc?: Location; | ||
name: NameNode; | ||
value: ValueNode; | ||
} | ||
@@ -386,6 +382,6 @@ | ||
export interface DirectiveNode { | ||
kind: 'Directive'; | ||
loc?: Location; | ||
name: NameNode; | ||
arguments?: ArgumentNode[]; | ||
kind: "Directive"; | ||
loc?: Location; | ||
name: NameNode; | ||
arguments?: ArgumentNode[]; | ||
} | ||
@@ -398,17 +394,17 @@ | ||
export interface NamedTypeNode { | ||
kind: 'NamedType'; | ||
loc?: Location; | ||
name: NameNode; | ||
kind: "NamedType"; | ||
loc?: Location; | ||
name: NameNode; | ||
} | ||
export interface ListTypeNode { | ||
kind: 'ListType'; | ||
loc?: Location; | ||
type: TypeNode; | ||
kind: "ListType"; | ||
loc?: Location; | ||
type: TypeNode; | ||
} | ||
export interface NonNullTypeNode { | ||
kind: 'NonNullType'; | ||
loc?: Location; | ||
type: NamedTypeNode | ListTypeNode; | ||
kind: "NonNullType"; | ||
loc?: Location; | ||
type: NamedTypeNode | ListTypeNode; | ||
} | ||
@@ -419,165 +415,165 @@ | ||
export type TypeSystemDefinitionNode = | ||
| SchemaDefinitionNode | ||
| TypeDefinitionNode | ||
| TypeExtensionNode | ||
| DirectiveDefinitionNode; | ||
| SchemaDefinitionNode | ||
| TypeDefinitionNode | ||
| TypeExtensionNode | ||
| DirectiveDefinitionNode; | ||
export interface SchemaDefinitionNode { | ||
kind: 'SchemaDefinition'; | ||
loc?: Location; | ||
directives: DirectiveNode[]; | ||
operationTypes: OperationTypeDefinitionNode[]; | ||
kind: "SchemaDefinition"; | ||
loc?: Location; | ||
directives: DirectiveNode[]; | ||
operationTypes: OperationTypeDefinitionNode[]; | ||
} | ||
export interface OperationTypeDefinitionNode { | ||
kind: 'OperationTypeDefinition'; | ||
loc?: Location; | ||
operation: OperationTypeNode; | ||
type: NamedTypeNode; | ||
kind: "OperationTypeDefinition"; | ||
loc?: Location; | ||
operation: OperationTypeNode; | ||
type: NamedTypeNode; | ||
} | ||
export type TypeDefinitionNode = | ||
| ScalarTypeDefinitionNode | ||
| ObjectTypeDefinitionNode | ||
| InterfaceTypeDefinitionNode | ||
| UnionTypeDefinitionNode | ||
| EnumTypeDefinitionNode | ||
| InputObjectTypeDefinitionNode; | ||
| ScalarTypeDefinitionNode | ||
| ObjectTypeDefinitionNode | ||
| InterfaceTypeDefinitionNode | ||
| UnionTypeDefinitionNode | ||
| EnumTypeDefinitionNode | ||
| InputObjectTypeDefinitionNode; | ||
export interface ScalarTypeDefinitionNode { | ||
kind: 'ScalarTypeDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
kind: "ScalarTypeDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
} | ||
export interface ObjectTypeDefinitionNode { | ||
kind: 'ObjectTypeDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
interfaces?: NamedTypeNode[]; | ||
directives?: DirectiveNode[]; | ||
fields: FieldDefinitionNode[]; | ||
kind: "ObjectTypeDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
interfaces?: NamedTypeNode[]; | ||
directives?: DirectiveNode[]; | ||
fields: FieldDefinitionNode[]; | ||
} | ||
export interface FieldDefinitionNode { | ||
kind: 'FieldDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
arguments: InputValueDefinitionNode[]; | ||
type: TypeNode; | ||
directives?: DirectiveNode[]; | ||
kind: "FieldDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
arguments: InputValueDefinitionNode[]; | ||
type: TypeNode; | ||
directives?: DirectiveNode[]; | ||
} | ||
export interface InputValueDefinitionNode { | ||
kind: 'InputValueDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
type: TypeNode; | ||
defaultValue?: ValueNode; | ||
directives?: DirectiveNode[]; | ||
kind: "InputValueDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
type: TypeNode; | ||
defaultValue?: ValueNode; | ||
directives?: DirectiveNode[]; | ||
} | ||
export interface InterfaceTypeDefinitionNode { | ||
kind: 'InterfaceTypeDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
fields: FieldDefinitionNode[]; | ||
kind: "InterfaceTypeDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
fields: FieldDefinitionNode[]; | ||
} | ||
export interface UnionTypeDefinitionNode { | ||
kind: 'UnionTypeDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
types: NamedTypeNode[]; | ||
kind: "UnionTypeDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
types: NamedTypeNode[]; | ||
} | ||
export interface EnumTypeDefinitionNode { | ||
kind: 'EnumTypeDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
values: EnumValueDefinitionNode[]; | ||
kind: "EnumTypeDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
values: EnumValueDefinitionNode[]; | ||
} | ||
export interface EnumValueDefinitionNode { | ||
kind: 'EnumValueDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
kind: "EnumValueDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
} | ||
export interface InputObjectTypeDefinitionNode { | ||
kind: 'InputObjectTypeDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
fields: InputValueDefinitionNode[]; | ||
kind: "InputObjectTypeDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
fields: InputValueDefinitionNode[]; | ||
} | ||
export type TypeExtensionNode = | ||
| ScalarTypeExtensionNode | ||
| ObjectTypeExtensionNode | ||
| InterfaceTypeExtensionNode | ||
| UnionTypeExtensionNode | ||
| EnumTypeExtensionNode | ||
| InputObjectTypeExtensionNode; | ||
| ScalarTypeExtensionNode | ||
| ObjectTypeExtensionNode | ||
| InterfaceTypeExtensionNode | ||
| UnionTypeExtensionNode | ||
| EnumTypeExtensionNode | ||
| InputObjectTypeExtensionNode; | ||
export type ScalarTypeExtensionNode = { | ||
kind: 'ScalarTypeExtension'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
kind: "ScalarTypeExtension"; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
}; | ||
export type ObjectTypeExtensionNode = { | ||
kind: 'ObjectTypeExtension'; | ||
loc?: Location; | ||
name: NameNode; | ||
interfaces?: NamedTypeNode[]; | ||
directives?: DirectiveNode[]; | ||
fields?: FieldDefinitionNode[]; | ||
kind: "ObjectTypeExtension"; | ||
loc?: Location; | ||
name: NameNode; | ||
interfaces?: NamedTypeNode[]; | ||
directives?: DirectiveNode[]; | ||
fields?: FieldDefinitionNode[]; | ||
}; | ||
export type InterfaceTypeExtensionNode = { | ||
kind: 'InterfaceTypeExtension'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
fields?: FieldDefinitionNode[]; | ||
kind: "InterfaceTypeExtension"; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
fields?: FieldDefinitionNode[]; | ||
}; | ||
export type UnionTypeExtensionNode = { | ||
kind: 'UnionTypeExtension'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
types?: NamedTypeNode[]; | ||
kind: "UnionTypeExtension"; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
types?: NamedTypeNode[]; | ||
}; | ||
export type EnumTypeExtensionNode = { | ||
kind: 'EnumTypeExtension'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
values?: EnumValueDefinitionNode[]; | ||
kind: "EnumTypeExtension"; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
values?: EnumValueDefinitionNode[]; | ||
}; | ||
export type InputObjectTypeExtensionNode = { | ||
kind: 'InputObjectTypeExtension'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
fields?: InputValueDefinitionNode[]; | ||
kind: "InputObjectTypeExtension"; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: DirectiveNode[]; | ||
fields?: InputValueDefinitionNode[]; | ||
}; | ||
@@ -588,8 +584,8 @@ | ||
export interface DirectiveDefinitionNode { | ||
kind: 'DirectiveDefinition'; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
arguments?: InputValueDefinitionNode[]; | ||
locations: NameNode[]; | ||
kind: "DirectiveDefinition"; | ||
loc?: Location; | ||
description?: StringValueNode; | ||
name: NameNode; | ||
arguments?: InputValueDefinitionNode[]; | ||
locations: NameNode[]; | ||
} |
@@ -1,15 +0,9 @@ | ||
export * from './ast'; | ||
export { getLocation } from './location'; | ||
import * as Kind from './kinds'; | ||
export * from "./ast"; | ||
export { getLocation } from "./location"; | ||
import * as Kind from "./kinds"; | ||
export { Kind }; | ||
export { createLexer, TokenKind, Lexer } from './lexer'; | ||
export { parse, parseValue, parseType, ParseOptions } from './parser'; | ||
export { print } from './printer'; | ||
export { Source } from './source'; | ||
export { | ||
visit, | ||
visitInParallel, | ||
visitWithTypeInfo, | ||
getVisitFn, | ||
BREAK, | ||
} from './visitor'; | ||
export { createLexer, TokenKind, Lexer } from "./lexer"; | ||
export { parse, parseValue, parseType, ParseOptions } from "./parser"; | ||
export { print } from "./printer"; | ||
export { Source } from "./source"; | ||
export { visit, visitInParallel, visitWithTypeInfo, getVisitFn, BREAK } from "./visitor"; |
// Name | ||
export const NAME: 'Name'; | ||
export const NAME: "Name"; | ||
// Document | ||
export const DOCUMENT: 'Document'; | ||
export const OPERATION_DEFINITION: 'OperationDefinition'; | ||
export const VARIABLE_DEFINITION: 'VariableDefinition'; | ||
export const VARIABLE: 'Variable'; | ||
export const SELECTION_SET: 'SelectionSet'; | ||
export const FIELD: 'Field'; | ||
export const ARGUMENT: 'Argument'; | ||
export const DOCUMENT: "Document"; | ||
export const OPERATION_DEFINITION: "OperationDefinition"; | ||
export const VARIABLE_DEFINITION: "VariableDefinition"; | ||
export const VARIABLE: "Variable"; | ||
export const SELECTION_SET: "SelectionSet"; | ||
export const FIELD: "Field"; | ||
export const ARGUMENT: "Argument"; | ||
// Fragments | ||
export const FRAGMENT_SPREAD: 'FragmentSpread'; | ||
export const INLINE_FRAGMENT: 'InlineFragment'; | ||
export const FRAGMENT_DEFINITION: 'FragmentDefinition'; | ||
export const FRAGMENT_SPREAD: "FragmentSpread"; | ||
export const INLINE_FRAGMENT: "InlineFragment"; | ||
export const FRAGMENT_DEFINITION: "FragmentDefinition"; | ||
// Values | ||
export const INT: 'IntValue'; | ||
export const FLOAT: 'FloatValue'; | ||
export const STRING: 'StringValue'; | ||
export const BOOLEAN: 'BooleanValue'; | ||
export const NULL: 'NullValue'; | ||
export const ENUM: 'EnumValue'; | ||
export const LIST: 'ListValue'; | ||
export const OBJECT: 'ObjectValue'; | ||
export const OBJECT_FIELD: 'ObjectField'; | ||
export const INT: "IntValue"; | ||
export const FLOAT: "FloatValue"; | ||
export const STRING: "StringValue"; | ||
export const BOOLEAN: "BooleanValue"; | ||
export const NULL: "NullValue"; | ||
export const ENUM: "EnumValue"; | ||
export const LIST: "ListValue"; | ||
export const OBJECT: "ObjectValue"; | ||
export const OBJECT_FIELD: "ObjectField"; | ||
// Directives | ||
export const DIRECTIVE: 'Directive'; | ||
export const DIRECTIVE: "Directive"; | ||
// Types | ||
export const NAMED_TYPE: 'NamedType'; | ||
export const LIST_TYPE: 'ListType'; | ||
export const NON_NULL_TYPE: 'NonNullType'; | ||
export const NAMED_TYPE: "NamedType"; | ||
export const LIST_TYPE: "ListType"; | ||
export const NON_NULL_TYPE: "NonNullType"; | ||
// Type System Definitions | ||
export const SCHEMA_DEFINITION: 'SchemaDefinition'; | ||
export const OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition'; | ||
export const SCHEMA_DEFINITION: "SchemaDefinition"; | ||
export const OPERATION_TYPE_DEFINITION: "OperationTypeDefinition"; | ||
// Type Definitions | ||
export const SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition'; | ||
export const OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition'; | ||
export const FIELD_DEFINITION: 'FieldDefinition'; | ||
export const INPUT_VALUE_DEFINITION: 'InputValueDefinition'; | ||
export const INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition'; | ||
export const UNION_TYPE_DEFINITION: 'UnionTypeDefinition'; | ||
export const ENUM_TYPE_DEFINITION: 'EnumTypeDefinition'; | ||
export const ENUM_VALUE_DEFINITION: 'EnumValueDefinition'; | ||
export const INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition'; | ||
export const SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition"; | ||
export const OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition"; | ||
export const FIELD_DEFINITION: "FieldDefinition"; | ||
export const INPUT_VALUE_DEFINITION: "InputValueDefinition"; | ||
export const INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition"; | ||
export const UNION_TYPE_DEFINITION: "UnionTypeDefinition"; | ||
export const ENUM_TYPE_DEFINITION: "EnumTypeDefinition"; | ||
export const ENUM_VALUE_DEFINITION: "EnumValueDefinition"; | ||
export const INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition"; | ||
// Type Extensions | ||
export const TYPE_EXTENSION_DEFINITION: 'TypeExtensionDefinition'; | ||
export const SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension'; | ||
export const OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension'; | ||
export const INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension'; | ||
export const UNION_TYPE_EXTENSION: 'UnionTypeExtension'; | ||
export const ENUM_TYPE_EXTENSION: 'EnumTypeExtension'; | ||
export const INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'; | ||
export const TYPE_EXTENSION_DEFINITION: "TypeExtensionDefinition"; | ||
export const SCALAR_TYPE_EXTENSION: "ScalarTypeExtension"; | ||
export const OBJECT_TYPE_EXTENSION: "ObjectTypeExtension"; | ||
export const INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension"; | ||
export const UNION_TYPE_EXTENSION: "UnionTypeExtension"; | ||
export const ENUM_TYPE_EXTENSION: "EnumTypeExtension"; | ||
export const INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"; | ||
// Directive Definitions | ||
export const DIRECTIVE_DEFINITION: 'DirectiveDefinition'; | ||
export const DIRECTIVE_DEFINITION: "DirectiveDefinition"; |
@@ -1,4 +0,4 @@ | ||
import { Token } from './ast'; | ||
import { Source } from './source'; | ||
import { syntaxError } from '../error'; | ||
import { Token } from "./ast"; | ||
import { Source } from "./source"; | ||
import { syntaxError } from "../error"; | ||
@@ -13,6 +13,3 @@ /** | ||
*/ | ||
export function createLexer<TOptions>( | ||
source: Source, | ||
options: TOptions, | ||
): Lexer<TOptions>; | ||
export function createLexer<TOptions>(source: Source, options: TOptions): Lexer<TOptions>; | ||
@@ -23,29 +20,29 @@ /** | ||
export interface Lexer<TOptions> { | ||
source: Source; | ||
options: TOptions; | ||
source: Source; | ||
options: TOptions; | ||
/** | ||
* The previously focused non-ignored token. | ||
*/ | ||
lastToken: Token; | ||
/** | ||
* The previously focused non-ignored token. | ||
*/ | ||
lastToken: Token; | ||
/** | ||
* The currently focused non-ignored token. | ||
*/ | ||
token: Token; | ||
/** | ||
* The currently focused non-ignored token. | ||
*/ | ||
token: Token; | ||
/** | ||
* The (1-indexed) line containing the current token. | ||
*/ | ||
line: number; | ||
/** | ||
* The (1-indexed) line containing the current token. | ||
*/ | ||
line: number; | ||
/** | ||
* The character offset at which the current line begins. | ||
*/ | ||
lineStart: number; | ||
/** | ||
* The character offset at which the current line begins. | ||
*/ | ||
lineStart: number; | ||
/** | ||
* Advances the token stream to the next non-ignored token. | ||
*/ | ||
advance(): Token; | ||
/** | ||
* Advances the token stream to the next non-ignored token. | ||
*/ | ||
advance(): Token; | ||
} | ||
@@ -58,22 +55,22 @@ | ||
export const TokenKind: { | ||
SOF: '<SOF>'; | ||
EOF: '<EOF>'; | ||
BANG: '!'; | ||
DOLLAR: '$'; | ||
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'; | ||
COMMENT: 'Comment'; | ||
SOF: "<SOF>"; | ||
EOF: "<EOF>"; | ||
BANG: "!"; | ||
DOLLAR: "$"; | ||
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"; | ||
COMMENT: "Comment"; | ||
}; | ||
@@ -80,0 +77,0 @@ |
@@ -1,8 +0,8 @@ | ||
import { Source } from './source'; | ||
import { Source } from "./source"; | ||
export interface SourceLocation { | ||
line: number; | ||
column: number; | ||
line: number; | ||
column: number; | ||
} | ||
export function getLocation(source: Source, position: number): SourceLocation; |
@@ -1,4 +0,4 @@ | ||
import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from './ast'; | ||
import { Source } from './source'; | ||
import { Lexer } from './lexer'; | ||
import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from "./ast"; | ||
import { Source } from "./source"; | ||
import { Lexer } from "./lexer"; | ||
@@ -9,47 +9,46 @@ /** | ||
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; | ||
/** | ||
* 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 a future major release. | ||
*/ | ||
allowLegacySDLEmptyFields?: 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 a future major release. | ||
*/ | ||
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 a future major release. | ||
*/ | ||
allowLegacySDLImplementsInterfaces?: 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 a future major release. | ||
*/ | ||
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 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; | ||
} | ||
@@ -61,6 +60,3 @@ | ||
*/ | ||
export function parse( | ||
source: string | Source, | ||
options?: ParseOptions, | ||
): DocumentNode; | ||
export function parse(source: string | Source, options?: ParseOptions): DocumentNode; | ||
@@ -74,6 +70,3 @@ /** | ||
*/ | ||
export function parseValue( | ||
source: Source | string, | ||
options?: ParseOptions, | ||
): ValueNode; | ||
export function parseValue(source: Source | string, options?: ParseOptions): ValueNode; | ||
@@ -90,6 +83,3 @@ /** | ||
*/ | ||
export function parseType( | ||
source: Source | string, | ||
options?: ParseOptions, | ||
): TypeNode; | ||
export function parseType(source: Source | string, options?: ParseOptions): TypeNode; | ||
@@ -96,0 +86,0 @@ export function parseConstValue<TOptions>(lexer: Lexer<TOptions>): ValueNode; |
export class Source { | ||
body: string; | ||
name: string; | ||
constructor(body: string, name?: string); | ||
body: string; | ||
name: string; | ||
constructor(body: string, name?: string); | ||
} |
export const QueryDocumentKeys: { | ||
Name: any[]; | ||
Document: string[]; | ||
OperationDefinition: string[]; | ||
VariableDefinition: string[]; | ||
Variable: string[]; | ||
SelectionSet: string[]; | ||
Field: string[]; | ||
Argument: string[]; | ||
Name: any[]; | ||
Document: string[]; | ||
OperationDefinition: string[]; | ||
VariableDefinition: string[]; | ||
Variable: string[]; | ||
SelectionSet: string[]; | ||
Field: string[]; | ||
Argument: string[]; | ||
FragmentSpread: string[]; | ||
InlineFragment: string[]; | ||
FragmentDefinition: string[]; | ||
FragmentSpread: string[]; | ||
InlineFragment: string[]; | ||
FragmentDefinition: string[]; | ||
IntValue: number[]; | ||
FloatValue: number[]; | ||
StringValue: string[]; | ||
BooleanValue: boolean[]; | ||
NullValue: null[]; | ||
EnumValue: any[]; | ||
ListValue: string[]; | ||
ObjectValue: string[]; | ||
ObjectField: string[]; | ||
IntValue: number[]; | ||
FloatValue: number[]; | ||
StringValue: string[]; | ||
BooleanValue: boolean[]; | ||
NullValue: null[]; | ||
EnumValue: any[]; | ||
ListValue: string[]; | ||
ObjectValue: string[]; | ||
ObjectField: string[]; | ||
Directive: string[]; | ||
Directive: string[]; | ||
NamedType: string[]; | ||
ListType: string[]; | ||
NonNullType: string[]; | ||
NamedType: string[]; | ||
ListType: string[]; | ||
NonNullType: string[]; | ||
ObjectTypeDefinition: string[]; | ||
FieldDefinition: string[]; | ||
InputValueDefinition: string[]; | ||
InterfaceTypeDefinition: string[]; | ||
UnionTypeDefinition: string[]; | ||
ScalarTypeDefinition: string[]; | ||
EnumTypeDefinition: string[]; | ||
EnumValueDefinition: string[]; | ||
InputObjectTypeDefinition: string[]; | ||
TypeExtensionDefinition: string[]; | ||
ObjectTypeDefinition: string[]; | ||
FieldDefinition: string[]; | ||
InputValueDefinition: string[]; | ||
InterfaceTypeDefinition: string[]; | ||
UnionTypeDefinition: string[]; | ||
ScalarTypeDefinition: string[]; | ||
EnumTypeDefinition: string[]; | ||
EnumValueDefinition: string[]; | ||
InputObjectTypeDefinition: string[]; | ||
TypeExtensionDefinition: string[]; | ||
}; | ||
@@ -42,0 +42,0 @@ |
{ | ||
"name": "@types/graphql", | ||
"version": "0.12.6", | ||
"version": "0.12.7", | ||
"description": "TypeScript definitions for graphql", | ||
@@ -80,4 +80,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "fa981755cca496c47ec2e137d7edcfdc74a24f57f2e7270421abdd8df2e0df53", | ||
"typesPublisherContentHash": "efe91c4ba0ea8a8230fd53dd3e2dd1341159db8e7c5b8c2cf2c1285c622546f5", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Thu, 22 Mar 2018 17:52:41 GMT | ||
* Last updated: Tue, 27 Mar 2018 18:51:52 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
@@ -1,1 +0,1 @@ | ||
export { subscribe, createSourceEventStream } from './subscribe'; | ||
export { subscribe, createSourceEventStream } from "./subscribe"; |
@@ -1,29 +0,29 @@ | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { DocumentNode } from '../language/ast'; | ||
import { GraphQLFieldResolver } from '../type/definition'; | ||
import { ExecutionResult } from '../execution/execute'; | ||
import { GraphQLSchema } from "../type/schema"; | ||
import { DocumentNode } from "../language/ast"; | ||
import { GraphQLFieldResolver } from "../type/definition"; | ||
import { ExecutionResult } from "../execution/execute"; | ||
export function subscribe( | ||
schema: GraphQLSchema, | ||
document: DocumentNode, | ||
rootValue?: any, | ||
contextValue?: any, | ||
variableValues?: { | ||
[key: string]: any; | ||
}, | ||
operationName?: string, | ||
fieldResolver?: GraphQLFieldResolver<any, any>, | ||
subscribeFieldResolver?: GraphQLFieldResolver<any, any>, | ||
schema: GraphQLSchema, | ||
document: DocumentNode, | ||
rootValue?: any, | ||
contextValue?: any, | ||
variableValues?: { | ||
[key: string]: any; | ||
}, | ||
operationName?: string, | ||
fieldResolver?: GraphQLFieldResolver<any, any>, | ||
subscribeFieldResolver?: GraphQLFieldResolver<any, any> | ||
): Promise<AsyncIterator<ExecutionResult> | ExecutionResult>; | ||
export function createSourceEventStream( | ||
schema: GraphQLSchema, | ||
document: DocumentNode, | ||
rootValue?: any, | ||
contextValue?: any, | ||
variableValues?: { | ||
[key: string]: any; | ||
}, | ||
operationName?: string, | ||
fieldResolver?: GraphQLFieldResolver<any, any>, | ||
schema: GraphQLSchema, | ||
document: DocumentNode, | ||
rootValue?: any, | ||
contextValue?: any, | ||
variableValues?: { | ||
[key: string]: any; | ||
}, | ||
operationName?: string, | ||
fieldResolver?: GraphQLFieldResolver<any, any> | ||
): Promise<AsyncIterable<any>>; |
import { | ||
ScalarTypeDefinitionNode, | ||
ObjectTypeDefinitionNode, | ||
FieldDefinitionNode, | ||
InputValueDefinitionNode, | ||
InterfaceTypeDefinitionNode, | ||
UnionTypeDefinitionNode, | ||
EnumTypeDefinitionNode, | ||
EnumValueDefinitionNode, | ||
InputObjectTypeDefinitionNode, | ||
TypeExtensionNode, | ||
OperationDefinitionNode, | ||
FieldNode, | ||
FragmentDefinitionNode, | ||
ValueNode, | ||
} from '../language/ast'; | ||
import { GraphQLSchema } from './schema'; | ||
ScalarTypeDefinitionNode, | ||
ObjectTypeDefinitionNode, | ||
FieldDefinitionNode, | ||
InputValueDefinitionNode, | ||
InterfaceTypeDefinitionNode, | ||
UnionTypeDefinitionNode, | ||
EnumTypeDefinitionNode, | ||
EnumValueDefinitionNode, | ||
InputObjectTypeDefinitionNode, | ||
TypeExtensionNode, | ||
OperationDefinitionNode, | ||
FieldNode, | ||
FragmentDefinitionNode, | ||
ValueNode, | ||
} from "../language/ast"; | ||
import { GraphQLSchema } from "./schema"; | ||
@@ -23,10 +23,10 @@ /** | ||
export type GraphQLType = | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any> | ||
| GraphQLNonNull<any>; | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any> | ||
| GraphQLNonNull<any>; | ||
@@ -41,12 +41,7 @@ export function isType(type: any): type is GraphQLType; | ||
export type GraphQLInputType = | ||
| GraphQLScalarType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any> | ||
| GraphQLNonNull< | ||
| GraphQLScalarType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any> | ||
>; | ||
| GraphQLScalarType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any> | ||
| GraphQLNonNull<GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType | GraphQLList<any>>; | ||
@@ -61,16 +56,16 @@ export function isInputType(type: GraphQLType): type is GraphQLInputType; | ||
export type GraphQLOutputType = | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLList<any> | ||
| GraphQLNonNull< | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLList<any> | ||
>; | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLList<any> | ||
| GraphQLNonNull< | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLList<any> | ||
>; | ||
@@ -93,10 +88,5 @@ export function isOutputType(type: GraphQLType): type is GraphQLOutputType; | ||
*/ | ||
export type GraphQLCompositeType = | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType; | ||
export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; | ||
export function isCompositeType( | ||
type: GraphQLType, | ||
): type is GraphQLCompositeType; | ||
export function isCompositeType(type: GraphQLType): type is GraphQLCompositeType; | ||
@@ -118,13 +108,11 @@ export function assertCompositeType(type: GraphQLType): GraphQLCompositeType; | ||
export type GraphQLNullableType = | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any>; | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any>; | ||
export function getNullableType<T extends GraphQLType>( | ||
type: T, | ||
): T & GraphQLNullableType; | ||
export function getNullableType<T extends GraphQLType>(type: T): T & GraphQLNullableType; | ||
@@ -135,8 +123,8 @@ /** | ||
export type GraphQLNamedType = | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType; | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType; | ||
@@ -173,26 +161,26 @@ export function isNamedType(type: GraphQLType): boolean; | ||
export class GraphQLScalarType { | ||
name: string; | ||
description: string; | ||
astNode?: ScalarTypeDefinitionNode; | ||
constructor(config: GraphQLScalarTypeConfig<any, any>); | ||
name: string; | ||
description: string; | ||
astNode?: ScalarTypeDefinitionNode; | ||
constructor(config: GraphQLScalarTypeConfig<any, any>); | ||
// Serializes an internal value to include in a response. | ||
serialize(value: 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 value to use as an input. | ||
parseValue(value: any): any; | ||
// Parses an externally provided literal value to use as an input. | ||
parseLiteral(valueNode: ValueNode): any; | ||
// Parses an externally provided literal value to use as an input. | ||
parseLiteral(valueNode: ValueNode): any; | ||
toString(): string; | ||
toString(): string; | ||
} | ||
export interface GraphQLScalarTypeConfig<TInternal, TExternal> { | ||
name: string; | ||
description?: string; | ||
astNode?: ScalarTypeDefinitionNode; | ||
serialize(value: any): TExternal | null | undefined; | ||
parseValue?(value: any): TInternal | null | undefined; | ||
parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; | ||
name: string; | ||
description?: string; | ||
astNode?: ScalarTypeDefinitionNode; | ||
serialize(value: any): TExternal | null | undefined; | ||
parseValue?(value: any): TInternal | null | undefined; | ||
parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; | ||
} | ||
@@ -238,119 +226,105 @@ | ||
export class GraphQLObjectType { | ||
name: string; | ||
description: string; | ||
astNode?: ObjectTypeDefinitionNode; | ||
extensionASTNodes: Array<TypeExtensionNode>; | ||
isTypeOf: GraphQLIsTypeOfFn<any, any>; | ||
name: string; | ||
description: string; | ||
astNode?: ObjectTypeDefinitionNode; | ||
extensionASTNodes: Array<TypeExtensionNode>; | ||
isTypeOf: GraphQLIsTypeOfFn<any, any>; | ||
constructor(config: GraphQLObjectTypeConfig<any, any>); | ||
getFields(): GraphQLFieldMap<any, any>; | ||
getInterfaces(): GraphQLInterfaceType[]; | ||
toString(): string; | ||
constructor(config: GraphQLObjectTypeConfig<any, any>); | ||
getFields(): GraphQLFieldMap<any, any>; | ||
getInterfaces(): GraphQLInterfaceType[]; | ||
toString(): string; | ||
} | ||
export interface GraphQLObjectTypeConfig<TSource, TContext> { | ||
name: string; | ||
interfaces?: Thunk<GraphQLInterfaceType[]>; | ||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>; | ||
isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext>; | ||
description?: string; | ||
astNode?: ObjectTypeDefinitionNode; | ||
extensionASTNodes?: Array<TypeExtensionNode>; | ||
name: string; | ||
interfaces?: Thunk<GraphQLInterfaceType[]>; | ||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>; | ||
isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext>; | ||
description?: string; | ||
astNode?: ObjectTypeDefinitionNode; | ||
extensionASTNodes?: Array<TypeExtensionNode>; | ||
} | ||
export type GraphQLTypeResolver<TSource, TContext> = ( | ||
value: TSource, | ||
context: TContext, | ||
info: GraphQLResolveInfo, | ||
value: TSource, | ||
context: TContext, | ||
info: GraphQLResolveInfo | ||
) => GraphQLObjectType | string | Promise<GraphQLObjectType | string>; | ||
export type GraphQLIsTypeOfFn<TSource, TContext> = ( | ||
source: TSource, | ||
context: TContext, | ||
info: GraphQLResolveInfo, | ||
source: TSource, | ||
context: TContext, | ||
info: GraphQLResolveInfo | ||
) => boolean | Promise<boolean>; | ||
export type GraphQLFieldResolver< | ||
TSource, | ||
TContext, | ||
TArgs = { [argName: string]: any } | ||
> = ( | ||
source: TSource, | ||
args: TArgs, | ||
context: TContext, | ||
info: GraphQLResolveInfo, | ||
export type GraphQLFieldResolver<TSource, TContext, TArgs = { [argName: string]: any }> = ( | ||
source: TSource, | ||
args: TArgs, | ||
context: TContext, | ||
info: GraphQLResolveInfo | ||
) => any; | ||
export interface GraphQLResolveInfo { | ||
fieldName: string; | ||
fieldNodes: FieldNode[]; | ||
returnType: GraphQLOutputType; | ||
parentType: GraphQLCompositeType; | ||
path: ResponsePath; | ||
schema: GraphQLSchema; | ||
fragments: { [fragmentName: string]: FragmentDefinitionNode }; | ||
rootValue: any; | ||
operation: OperationDefinitionNode; | ||
variableValues: { [variableName: string]: any }; | ||
fieldName: string; | ||
fieldNodes: FieldNode[]; | ||
returnType: GraphQLOutputType; | ||
parentType: GraphQLCompositeType; | ||
path: ResponsePath; | ||
schema: GraphQLSchema; | ||
fragments: { [fragmentName: string]: FragmentDefinitionNode }; | ||
rootValue: any; | ||
operation: OperationDefinitionNode; | ||
variableValues: { [variableName: string]: any }; | ||
} | ||
export type ResponsePath = | ||
| { prev: ResponsePath; key: string | number } | ||
| undefined; | ||
export type ResponsePath = { prev: ResponsePath; key: string | number } | undefined; | ||
export interface GraphQLFieldConfig< | ||
TSource, | ||
TContext, | ||
TArgs = { [argName: string]: any } | ||
> { | ||
type: GraphQLOutputType; | ||
args?: GraphQLFieldConfigArgumentMap; | ||
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>; | ||
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>; | ||
deprecationReason?: string; | ||
description?: string; | ||
astNode?: FieldDefinitionNode; | ||
export interface GraphQLFieldConfig<TSource, TContext, TArgs = { [argName: string]: any }> { | ||
type: GraphQLOutputType; | ||
args?: GraphQLFieldConfigArgumentMap; | ||
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>; | ||
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>; | ||
deprecationReason?: string; | ||
description?: string; | ||
astNode?: FieldDefinitionNode; | ||
} | ||
export interface GraphQLFieldConfigArgumentMap { | ||
[argName: string]: GraphQLArgumentConfig; | ||
[argName: string]: GraphQLArgumentConfig; | ||
} | ||
export interface GraphQLArgumentConfig { | ||
type: GraphQLInputType; | ||
defaultValue?: any; | ||
description?: string; | ||
astNode?: InputValueDefinitionNode; | ||
type: GraphQLInputType; | ||
defaultValue?: any; | ||
description?: string; | ||
astNode?: InputValueDefinitionNode; | ||
} | ||
export interface GraphQLFieldConfigMap<TSource, TContext> { | ||
[fieldName: string]: GraphQLFieldConfig<TSource, TContext>; | ||
[fieldName: string]: GraphQLFieldConfig<TSource, TContext>; | ||
} | ||
export interface GraphQLField< | ||
TSource, | ||
TContext, | ||
TArgs = { [argName: string]: any } | ||
> { | ||
name: string; | ||
description: string; | ||
type: GraphQLOutputType; | ||
args: GraphQLArgument[]; | ||
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>; | ||
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>; | ||
isDeprecated?: boolean; | ||
deprecationReason?: string; | ||
astNode?: FieldDefinitionNode; | ||
export interface GraphQLField<TSource, TContext, TArgs = { [argName: string]: any }> { | ||
name: string; | ||
description: string; | ||
type: GraphQLOutputType; | ||
args: GraphQLArgument[]; | ||
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>; | ||
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>; | ||
isDeprecated?: boolean; | ||
deprecationReason?: string; | ||
astNode?: FieldDefinitionNode; | ||
} | ||
export interface GraphQLArgument { | ||
name: string; | ||
type: GraphQLInputType; | ||
defaultValue?: any; | ||
description?: string; | ||
astNode?: InputValueDefinitionNode; | ||
name: string; | ||
type: GraphQLInputType; | ||
defaultValue?: any; | ||
description?: string; | ||
astNode?: InputValueDefinitionNode; | ||
} | ||
export interface GraphQLFieldMap<TSource, TContext> { | ||
[fieldName: string]: GraphQLField<TSource, TContext>; | ||
[fieldName: string]: GraphQLField<TSource, TContext>; | ||
} | ||
@@ -377,25 +351,25 @@ | ||
export class GraphQLInterfaceType { | ||
name: string; | ||
description: string; | ||
astNode?: InterfaceTypeDefinitionNode; | ||
resolveType: GraphQLTypeResolver<any, any>; | ||
name: string; | ||
description: string; | ||
astNode?: InterfaceTypeDefinitionNode; | ||
resolveType: GraphQLTypeResolver<any, any>; | ||
constructor(config: GraphQLInterfaceTypeConfig<any, any>); | ||
constructor(config: GraphQLInterfaceTypeConfig<any, any>); | ||
getFields(): GraphQLFieldMap<any, any>; | ||
getFields(): GraphQLFieldMap<any, any>; | ||
toString(): string; | ||
toString(): string; | ||
} | ||
export interface GraphQLInterfaceTypeConfig<TSource, TContext> { | ||
name: string; | ||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>; | ||
/** | ||
* Optionally provide a custom type resolver function. If one is not provided, | ||
* the default implementation will call `isTypeOf` on each implementing | ||
* Object type. | ||
*/ | ||
resolveType?: GraphQLTypeResolver<TSource, TContext>; | ||
description?: string; | ||
astNode?: InterfaceTypeDefinitionNode; | ||
name: string; | ||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>; | ||
/** | ||
* Optionally provide a custom type resolver function. If one is not provided, | ||
* the default implementation will call `isTypeOf` on each implementing | ||
* Object type. | ||
*/ | ||
resolveType?: GraphQLTypeResolver<TSource, TContext>; | ||
description?: string; | ||
astNode?: InterfaceTypeDefinitionNode; | ||
} | ||
@@ -427,25 +401,25 @@ | ||
export class GraphQLUnionType { | ||
name: string; | ||
description: string; | ||
astNode?: UnionTypeDefinitionNode; | ||
resolveType: GraphQLTypeResolver<any, any>; | ||
name: string; | ||
description: string; | ||
astNode?: UnionTypeDefinitionNode; | ||
resolveType: GraphQLTypeResolver<any, any>; | ||
constructor(config: GraphQLUnionTypeConfig<any, any>); | ||
constructor(config: GraphQLUnionTypeConfig<any, any>); | ||
getTypes(): GraphQLObjectType[]; | ||
getTypes(): GraphQLObjectType[]; | ||
toString(): string; | ||
toString(): 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?: GraphQLTypeResolver<TSource, TContext>; | ||
description?: string; | ||
astNode?: UnionTypeDefinitionNode; | ||
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?: GraphQLTypeResolver<TSource, TContext>; | ||
description?: string; | ||
astNode?: UnionTypeDefinitionNode; | ||
} | ||
@@ -475,41 +449,41 @@ | ||
export class GraphQLEnumType { | ||
name: string; | ||
description: string; | ||
astNode?: EnumTypeDefinitionNode; | ||
name: string; | ||
description: string; | ||
astNode?: EnumTypeDefinitionNode; | ||
constructor(config: GraphQLEnumTypeConfig); | ||
getValues(): GraphQLEnumValue[]; | ||
getValue(name: string): GraphQLEnumValue; | ||
isValidValue(value: any): boolean; | ||
serialize(value: any): string; | ||
parseValue(value: any): any; | ||
parseLiteral(valueNode: ValueNode): any; | ||
toString(): string; | ||
constructor(config: GraphQLEnumTypeConfig); | ||
getValues(): GraphQLEnumValue[]; | ||
getValue(name: string): GraphQLEnumValue; | ||
isValidValue(value: any): boolean; | ||
serialize(value: any): string; | ||
parseValue(value: any): any; | ||
parseLiteral(valueNode: ValueNode): any; | ||
toString(): string; | ||
} | ||
export interface GraphQLEnumTypeConfig { | ||
name: string; | ||
values: GraphQLEnumValueConfigMap; | ||
description?: string; | ||
astNode?: EnumTypeDefinitionNode; | ||
name: string; | ||
values: GraphQLEnumValueConfigMap; | ||
description?: string; | ||
astNode?: EnumTypeDefinitionNode; | ||
} | ||
export interface GraphQLEnumValueConfigMap { | ||
[valueName: string]: GraphQLEnumValueConfig; | ||
[valueName: string]: GraphQLEnumValueConfig; | ||
} | ||
export interface GraphQLEnumValueConfig { | ||
value?: any; | ||
deprecationReason?: string; | ||
description?: string; | ||
astNode?: EnumValueDefinitionNode; | ||
value?: any; | ||
deprecationReason?: string; | ||
description?: string; | ||
astNode?: EnumValueDefinitionNode; | ||
} | ||
export interface GraphQLEnumValue { | ||
name: string; | ||
description: string; | ||
isDeprecated?: boolean; | ||
deprecationReason: string; | ||
astNode?: EnumValueDefinitionNode; | ||
value: any; | ||
name: string; | ||
description: string; | ||
isDeprecated?: boolean; | ||
deprecationReason: string; | ||
astNode?: EnumValueDefinitionNode; | ||
value: any; | ||
} | ||
@@ -538,38 +512,38 @@ | ||
export class GraphQLInputObjectType { | ||
name: string; | ||
description: string; | ||
astNode?: InputObjectTypeDefinitionNode; | ||
constructor(config: GraphQLInputObjectTypeConfig); | ||
getFields(): GraphQLInputFieldMap; | ||
toString(): string; | ||
name: string; | ||
description: string; | ||
astNode?: InputObjectTypeDefinitionNode; | ||
constructor(config: GraphQLInputObjectTypeConfig); | ||
getFields(): GraphQLInputFieldMap; | ||
toString(): string; | ||
} | ||
export interface GraphQLInputObjectTypeConfig { | ||
name: string; | ||
fields: Thunk<GraphQLInputFieldConfigMap>; | ||
description?: string; | ||
astNode?: InputObjectTypeDefinitionNode; | ||
name: string; | ||
fields: Thunk<GraphQLInputFieldConfigMap>; | ||
description?: string; | ||
astNode?: InputObjectTypeDefinitionNode; | ||
} | ||
export interface GraphQLInputFieldConfig { | ||
type: GraphQLInputType; | ||
defaultValue?: any; | ||
description?: string; | ||
astNode?: InputValueDefinitionNode; | ||
type: GraphQLInputType; | ||
defaultValue?: any; | ||
description?: string; | ||
astNode?: InputValueDefinitionNode; | ||
} | ||
export interface GraphQLInputFieldConfigMap { | ||
[fieldName: string]: GraphQLInputFieldConfig; | ||
[fieldName: string]: GraphQLInputFieldConfig; | ||
} | ||
export interface GraphQLInputField { | ||
name: string; | ||
type: GraphQLInputType; | ||
defaultValue?: any; | ||
description?: string; | ||
astNode?: InputValueDefinitionNode; | ||
name: string; | ||
type: GraphQLInputType; | ||
defaultValue?: any; | ||
description?: string; | ||
astNode?: InputValueDefinitionNode; | ||
} | ||
export interface GraphQLInputFieldMap { | ||
[fieldName: string]: GraphQLInputField; | ||
[fieldName: string]: GraphQLInputField; | ||
} | ||
@@ -596,5 +570,5 @@ | ||
export class GraphQLList<T extends GraphQLType> { | ||
ofType: T; | ||
constructor(type: T); | ||
toString(): string; | ||
ofType: T; | ||
constructor(type: T); | ||
toString(): string; | ||
} | ||
@@ -623,7 +597,7 @@ | ||
export class GraphQLNonNull<T extends GraphQLNullableType> { | ||
ofType: T; | ||
ofType: T; | ||
constructor(type: T); | ||
constructor(type: T); | ||
toString(): string; | ||
toString(): string; | ||
} |
@@ -1,25 +0,25 @@ | ||
import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition'; | ||
import { DirectiveDefinitionNode } from '../language/ast'; | ||
import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from "./definition"; | ||
import { DirectiveDefinitionNode } from "../language/ast"; | ||
export const DirectiveLocation: { | ||
// Operations | ||
QUERY: 'QUERY'; | ||
MUTATION: 'MUTATION'; | ||
SUBSCRIPTION: 'SUBSCRIPTION'; | ||
FIELD: 'FIELD'; | ||
FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION'; | ||
FRAGMENT_SPREAD: 'FRAGMENT_SPREAD'; | ||
INLINE_FRAGMENT: 'INLINE_FRAGMENT'; | ||
// Schema 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'; | ||
// Operations | ||
QUERY: "QUERY"; | ||
MUTATION: "MUTATION"; | ||
SUBSCRIPTION: "SUBSCRIPTION"; | ||
FIELD: "FIELD"; | ||
FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; | ||
FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; | ||
INLINE_FRAGMENT: "INLINE_FRAGMENT"; | ||
// Schema 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"; | ||
}; | ||
@@ -34,17 +34,17 @@ | ||
export class GraphQLDirective { | ||
name: string; | ||
description?: string; | ||
locations: DirectiveLocationEnum[]; | ||
args: GraphQLArgument[]; | ||
astNode?: DirectiveDefinitionNode; | ||
name: string; | ||
description?: string; | ||
locations: DirectiveLocationEnum[]; | ||
args: GraphQLArgument[]; | ||
astNode?: DirectiveDefinitionNode; | ||
constructor(config: GraphQLDirectiveConfig); | ||
constructor(config: GraphQLDirectiveConfig); | ||
} | ||
export interface GraphQLDirectiveConfig { | ||
name: string; | ||
description?: string; | ||
locations: DirectiveLocationEnum[]; | ||
args?: GraphQLFieldConfigArgumentMap; | ||
astNode?: DirectiveDefinitionNode; | ||
name: string; | ||
description?: string; | ||
locations: DirectiveLocationEnum[]; | ||
args?: GraphQLFieldConfigArgumentMap; | ||
astNode?: DirectiveDefinitionNode; | ||
} | ||
@@ -65,3 +65,3 @@ | ||
*/ | ||
export const DEFAULT_DEPRECATION_REASON: 'No longer supported'; | ||
export const DEFAULT_DEPRECATION_REASON: "No longer supported"; | ||
@@ -68,0 +68,0 @@ /** |
// GraphQL Schema definition | ||
export { GraphQLSchema } from './schema'; | ||
export { GraphQLSchema } from "./schema"; | ||
export * from './definition'; | ||
export * from "./definition"; | ||
export { | ||
// "Enum" of Directive Locations | ||
DirectiveLocation, | ||
// Directives Definition | ||
GraphQLDirective, | ||
// Built-in Directives defined by the Spec | ||
specifiedDirectives, | ||
GraphQLIncludeDirective, | ||
GraphQLSkipDirective, | ||
GraphQLDeprecatedDirective, | ||
// Constant Deprecation Reason | ||
DEFAULT_DEPRECATION_REASON, | ||
} from './directives'; | ||
// "Enum" of Directive Locations | ||
DirectiveLocation, | ||
// Directives Definition | ||
GraphQLDirective, | ||
// Built-in Directives defined by the Spec | ||
specifiedDirectives, | ||
GraphQLIncludeDirective, | ||
GraphQLSkipDirective, | ||
GraphQLDeprecatedDirective, | ||
// Constant Deprecation Reason | ||
DEFAULT_DEPRECATION_REASON, | ||
} from "./directives"; | ||
// Common built-in scalar instances. | ||
export { | ||
GraphQLInt, | ||
GraphQLFloat, | ||
GraphQLString, | ||
GraphQLBoolean, | ||
GraphQLID, | ||
} from './scalars'; | ||
export { GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID } from "./scalars"; | ||
export { | ||
// "Enum" of Type Kinds | ||
TypeKind, | ||
// GraphQL Types for introspection. | ||
__Schema, | ||
__Directive, | ||
__DirectiveLocation, | ||
__Type, | ||
__Field, | ||
__InputValue, | ||
__EnumValue, | ||
__TypeKind, | ||
// Meta-field definitions. | ||
SchemaMetaFieldDef, | ||
TypeMetaFieldDef, | ||
TypeNameMetaFieldDef, | ||
} from './introspection'; | ||
// "Enum" of Type Kinds | ||
TypeKind, | ||
// GraphQL Types for introspection. | ||
__Schema, | ||
__Directive, | ||
__DirectiveLocation, | ||
__Type, | ||
__Field, | ||
__InputValue, | ||
__EnumValue, | ||
__TypeKind, | ||
// Meta-field definitions. | ||
SchemaMetaFieldDef, | ||
TypeMetaFieldDef, | ||
TypeNameMetaFieldDef, | ||
} from "./introspection"; | ||
export { DirectiveLocationEnum } from './directives'; | ||
export { DirectiveLocationEnum } from "./directives"; |
import { | ||
GraphQLScalarType, | ||
GraphQLObjectType, | ||
GraphQLInterfaceType, | ||
GraphQLUnionType, | ||
GraphQLEnumType, | ||
GraphQLInputObjectType, | ||
GraphQLList, | ||
GraphQLNonNull, | ||
} from './definition'; | ||
import { GraphQLField } from './definition'; | ||
GraphQLScalarType, | ||
GraphQLObjectType, | ||
GraphQLInterfaceType, | ||
GraphQLUnionType, | ||
GraphQLEnumType, | ||
GraphQLInputObjectType, | ||
GraphQLList, | ||
GraphQLNonNull, | ||
} from "./definition"; | ||
import { GraphQLField } from "./definition"; | ||
@@ -22,10 +22,10 @@ export const __Schema: GraphQLObjectType; | ||
export const TypeKind: { | ||
SCALAR: 'SCALAR'; | ||
OBJECT: 'OBJECT'; | ||
INTERFACE: 'INTERFACE'; | ||
UNION: 'UNION'; | ||
ENUM: 'ENUM'; | ||
INPUT_OBJECT: 'INPUT_OBJECT'; | ||
LIST: 'LIST'; | ||
NON_NULL: 'NON_NULL'; | ||
SCALAR: "SCALAR"; | ||
OBJECT: "OBJECT"; | ||
INTERFACE: "INTERFACE"; | ||
UNION: "UNION"; | ||
ENUM: "ENUM"; | ||
INPUT_OBJECT: "INPUT_OBJECT"; | ||
LIST: "LIST"; | ||
NON_NULL: "NON_NULL"; | ||
}; | ||
@@ -32,0 +32,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { GraphQLScalarType } from './definition'; | ||
import { GraphQLScalarType } from "./definition"; | ||
@@ -3,0 +3,0 @@ export const GraphQLInt: GraphQLScalarType; |
@@ -1,9 +0,5 @@ | ||
import { GraphQLObjectType } from './definition'; | ||
import { | ||
GraphQLType, | ||
GraphQLNamedType, | ||
GraphQLAbstractType, | ||
} from './definition'; | ||
import { SchemaDefinitionNode } from '../language/ast'; | ||
import { GraphQLDirective } from './directives'; | ||
import { GraphQLObjectType } from "./definition"; | ||
import { GraphQLType, GraphQLNamedType, GraphQLAbstractType } from "./definition"; | ||
import { SchemaDefinitionNode } from "../language/ast"; | ||
import { GraphQLDirective } from "./directives"; | ||
@@ -37,57 +33,54 @@ /** | ||
export class GraphQLSchema { | ||
astNode?: SchemaDefinitionNode; | ||
// private _queryType: GraphQLObjectType; | ||
// private _mutationType: GraphQLObjectType; | ||
// private _subscriptionType: GraphQLObjectType; | ||
// private _directives: Array<GraphQLDirective>; | ||
// private _typeMap: TypeMap; | ||
// private _implementations: { [interfaceName: string]: Array<GraphQLObjectType> }; | ||
// private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; | ||
astNode?: SchemaDefinitionNode; | ||
// private _queryType: GraphQLObjectType; | ||
// private _mutationType: GraphQLObjectType; | ||
// private _subscriptionType: GraphQLObjectType; | ||
// private _directives: Array<GraphQLDirective>; | ||
// private _typeMap: TypeMap; | ||
// private _implementations: { [interfaceName: string]: Array<GraphQLObjectType> }; | ||
// private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; | ||
constructor(config: GraphQLSchemaConfig); | ||
constructor(config: GraphQLSchemaConfig); | ||
getQueryType(): GraphQLObjectType; | ||
getMutationType(): GraphQLObjectType | null | undefined; | ||
getSubscriptionType(): GraphQLObjectType | null | undefined; | ||
getTypeMap(): { [typeName: string]: GraphQLNamedType }; | ||
getType(name: string): GraphQLNamedType; | ||
getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; | ||
getQueryType(): GraphQLObjectType; | ||
getMutationType(): GraphQLObjectType | null | undefined; | ||
getSubscriptionType(): GraphQLObjectType | null | undefined; | ||
getTypeMap(): { [typeName: string]: GraphQLNamedType }; | ||
getType(name: string): GraphQLNamedType; | ||
getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; | ||
isPossibleType( | ||
abstractType: GraphQLAbstractType, | ||
possibleType: GraphQLObjectType, | ||
): boolean; | ||
isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; | ||
getDirectives(): GraphQLDirective[]; | ||
getDirective(name: string): GraphQLDirective; | ||
getDirectives(): GraphQLDirective[]; | ||
getDirective(name: string): GraphQLDirective; | ||
} | ||
export type 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; | ||
/** | ||
* 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 may be removed in a future | ||
* major release. | ||
*/ | ||
allowedLegacyNames?: ReadonlyArray<string>; | ||
/** | ||
* 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 may be removed in a future | ||
* major release. | ||
*/ | ||
allowedLegacyNames?: ReadonlyArray<string>; | ||
}; | ||
export interface GraphQLSchemaConfig { | ||
query: GraphQLObjectType; | ||
mutation?: GraphQLObjectType; | ||
subscription?: GraphQLObjectType; | ||
types?: GraphQLNamedType[]; | ||
directives?: GraphQLDirective[]; | ||
astNode?: SchemaDefinitionNode; | ||
query: GraphQLObjectType; | ||
mutation?: GraphQLObjectType; | ||
subscription?: GraphQLObjectType; | ||
types?: GraphQLNamedType[]; | ||
directives?: GraphQLDirective[]; | ||
astNode?: SchemaDefinitionNode; | ||
} |
import { | ||
ValueNode, | ||
/* | ||
ValueNode, | ||
/* | ||
TODO: | ||
@@ -13,4 +13,4 @@ IntValueNode, | ||
*/ | ||
} from '../language/ast'; | ||
import { GraphQLInputType } from '../type/definition'; | ||
} from "../language/ast"; | ||
import { GraphQLInputType } from "../type/definition"; | ||
@@ -17,0 +17,0 @@ /** |
@@ -1,14 +0,14 @@ | ||
import { DocumentNode, Location, StringValueNode } from '../language/ast'; | ||
import { Source } from '../language/source'; | ||
import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; | ||
import { DocumentNode, Location, StringValueNode } from "../language/ast"; | ||
import { Source } from "../language/source"; | ||
import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema"; | ||
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. | ||
* | ||
* Default: false | ||
*/ | ||
commentDescriptions?: boolean; | ||
/** | ||
* 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. | ||
* | ||
* Default: false | ||
*/ | ||
commentDescriptions?: boolean; | ||
} | ||
@@ -38,4 +38,4 @@ | ||
export function getDescription( | ||
node: { description?: StringValueNode; loc?: Location }, | ||
options: BuildSchemaOptions | ||
node: { description?: StringValueNode; loc?: Location }, | ||
options: BuildSchemaOptions | ||
): string; | ||
@@ -42,0 +42,0 @@ |
@@ -1,3 +0,3 @@ | ||
import { IntrospectionQuery } from './introspectionQuery'; | ||
import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; | ||
import { IntrospectionQuery } from "./introspectionQuery"; | ||
import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema"; | ||
@@ -15,5 +15,2 @@ interface Options extends GraphQLSchemaValidationOptions {} | ||
*/ | ||
export function buildClientSchema( | ||
introspection: IntrospectionQuery, | ||
options?: Options, | ||
): GraphQLSchema; | ||
export function buildClientSchema(introspection: IntrospectionQuery, options?: Options): GraphQLSchema; |
@@ -1,2 +0,2 @@ | ||
import { DocumentNode } from '../language/ast'; | ||
import { DocumentNode } from "../language/ast"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { DocumentNode } from '../language/ast'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { DocumentNode } from "../language/ast"; | ||
import { GraphQLSchema } from "../type/schema"; | ||
@@ -16,5 +16,2 @@ /** | ||
*/ | ||
export function extendSchema( | ||
schema: GraphQLSchema, | ||
documentAST: DocumentNode, | ||
): GraphQLSchema; | ||
export function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode): GraphQLSchema; |
import { | ||
getNamedType, | ||
GraphQLScalarType, | ||
GraphQLEnumType, | ||
GraphQLInputObjectType, | ||
GraphQLInterfaceType, | ||
GraphQLObjectType, | ||
GraphQLUnionType, | ||
GraphQLNamedType, | ||
} from '../type/definition'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
getNamedType, | ||
GraphQLScalarType, | ||
GraphQLEnumType, | ||
GraphQLInputObjectType, | ||
GraphQLInterfaceType, | ||
GraphQLObjectType, | ||
GraphQLUnionType, | ||
GraphQLNamedType, | ||
} from "../type/definition"; | ||
import { GraphQLSchema } from "../type/schema"; | ||
export const 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'; | ||
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"; | ||
}; | ||
export type BreakingChangeKey = | ||
| 'FIELD_CHANGED_KIND' | ||
| 'FIELD_REMOVED' | ||
| 'TYPE_CHANGED_KIND' | ||
| 'TYPE_REMOVED' | ||
| 'TYPE_REMOVED_FROM_UNION' | ||
| 'VALUE_REMOVED_FROM_ENUM'; | ||
| "FIELD_CHANGED_KIND" | ||
| "FIELD_REMOVED" | ||
| "TYPE_CHANGED_KIND" | ||
| "TYPE_REMOVED" | ||
| "TYPE_REMOVED_FROM_UNION" | ||
| "VALUE_REMOVED_FROM_ENUM"; | ||
export interface BreakingChange { | ||
type: BreakingChangeKey; | ||
description: string; | ||
type: BreakingChangeKey; | ||
description: string; | ||
} | ||
@@ -39,6 +39,3 @@ | ||
*/ | ||
export function findBreakingChanges( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
export function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; | ||
@@ -49,6 +46,3 @@ /** | ||
*/ | ||
export function findRemovedTypes( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
export function findRemovedTypes(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; | ||
@@ -59,6 +53,3 @@ /** | ||
*/ | ||
export function findTypesThatChangedKind( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
export function findTypesThatChangedKind(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; | ||
@@ -70,6 +61,3 @@ /** | ||
*/ | ||
export function findFieldsThatChangedType( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
export function findFieldsThatChangedType(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; | ||
@@ -80,6 +68,3 @@ /** | ||
*/ | ||
export function findTypesRemovedFromUnions( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
export function findTypesRemovedFromUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; | ||
@@ -90,5 +75,2 @@ /** | ||
*/ | ||
export function findValuesRemovedFromEnums( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
export function findValuesRemovedFromEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; |
@@ -1,4 +0,4 @@ | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { DocumentNode } from '../language/ast'; | ||
import { GraphQLError } from '../error/GraphQLError'; | ||
import { GraphQLSchema } from "../type/schema"; | ||
import { DocumentNode } from "../language/ast"; | ||
import { GraphQLError } from "../error/GraphQLError"; | ||
@@ -10,5 +10,2 @@ /** | ||
*/ | ||
export function findDeprecatedUsages( | ||
schema: GraphQLSchema, | ||
ast: DocumentNode, | ||
): GraphQLError[]; | ||
export function findDeprecatedUsages(schema: GraphQLSchema, ast: DocumentNode): GraphQLError[]; |
@@ -1,2 +0,2 @@ | ||
import { DocumentNode, OperationDefinitionNode } from '../language/ast'; | ||
import { DocumentNode, OperationDefinitionNode } from "../language/ast"; | ||
@@ -8,5 +8,2 @@ /** | ||
*/ | ||
export function getOperationAST( | ||
documentAST: DocumentNode, | ||
operationName?: string, | ||
): OperationDefinitionNode; | ||
export function getOperationAST(documentAST: DocumentNode, operationName?: string): OperationDefinitionNode; |
// The GraphQL query recommended for a full schema introspection. | ||
export { introspectionQuery } from './introspectionQuery'; | ||
export { introspectionQuery } from "./introspectionQuery"; | ||
export { | ||
IntrospectionQuery, | ||
IntrospectionSchema, | ||
IntrospectionType, | ||
IntrospectionScalarType, | ||
IntrospectionObjectType, | ||
IntrospectionInterfaceType, | ||
IntrospectionUnionType, | ||
IntrospectionEnumType, | ||
IntrospectionInputObjectType, | ||
IntrospectionTypeRef, | ||
IntrospectionNamedTypeRef, | ||
IntrospectionListTypeRef, | ||
IntrospectionNonNullTypeRef, | ||
IntrospectionField, | ||
IntrospectionInputValue, | ||
IntrospectionEnumValue, | ||
IntrospectionDirective, | ||
} from './introspectionQuery'; | ||
IntrospectionQuery, | ||
IntrospectionSchema, | ||
IntrospectionType, | ||
IntrospectionScalarType, | ||
IntrospectionObjectType, | ||
IntrospectionInterfaceType, | ||
IntrospectionUnionType, | ||
IntrospectionEnumType, | ||
IntrospectionInputObjectType, | ||
IntrospectionTypeRef, | ||
IntrospectionNamedTypeRef, | ||
IntrospectionListTypeRef, | ||
IntrospectionNonNullTypeRef, | ||
IntrospectionField, | ||
IntrospectionInputValue, | ||
IntrospectionEnumValue, | ||
IntrospectionDirective, | ||
} from "./introspectionQuery"; | ||
// Gets the target Operation from a Document | ||
export { getOperationAST } from './getOperationAST'; | ||
export { getOperationAST } from "./getOperationAST"; | ||
// Build a GraphQLSchema from an introspection result. | ||
export { buildClientSchema } from './buildClientSchema'; | ||
export { buildClientSchema } from "./buildClientSchema"; | ||
// Build a GraphQLSchema from GraphQL Schema language. | ||
export { buildASTSchema, buildSchema, getDescription } from './buildASTSchema'; | ||
export { buildASTSchema, buildSchema, getDescription } from "./buildASTSchema"; | ||
// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. | ||
export { extendSchema } from './extendSchema'; | ||
export { extendSchema } from "./extendSchema"; | ||
// Print a GraphQLSchema to GraphQL Schema language. | ||
export { | ||
printSchema, | ||
printType, | ||
printIntrospectionSchema, | ||
} from './schemaPrinter'; | ||
export { printSchema, printType, printIntrospectionSchema } from "./schemaPrinter"; | ||
// Create a GraphQLType from a GraphQL language AST. | ||
export { typeFromAST } from './typeFromAST'; | ||
export { typeFromAST } from "./typeFromAST"; | ||
// Create a JavaScript value from a GraphQL language AST. | ||
export { valueFromAST } from './valueFromAST'; | ||
export { valueFromAST } from "./valueFromAST"; | ||
// Create a GraphQL language AST from a JavaScript value. | ||
export { astFromValue } from './astFromValue'; | ||
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'; | ||
export { TypeInfo } from "./TypeInfo"; | ||
// Determine if JavaScript values adhere to a GraphQL type. | ||
export { isValidJSValue } from './isValidJSValue'; | ||
export { isValidJSValue } from "./isValidJSValue"; | ||
// Determine if AST values adhere to a GraphQL type. | ||
export { isValidLiteralValue } from './isValidLiteralValue'; | ||
export { isValidLiteralValue } from "./isValidLiteralValue"; | ||
// Concatenates multiple AST together. | ||
export { concatAST } from './concatAST'; | ||
export { concatAST } from "./concatAST"; | ||
// Separates an AST into an AST per Operation. | ||
export { separateOperations } from './separateOperations'; | ||
export { separateOperations } from "./separateOperations"; | ||
// Comparators for types | ||
export { | ||
isEqualType, | ||
isTypeSubTypeOf, | ||
doTypesOverlap, | ||
} from './typeComparators'; | ||
export { isEqualType, isTypeSubTypeOf, doTypesOverlap } from "./typeComparators"; | ||
// Asserts that a string is a valid GraphQL name | ||
export { assertValidName } from './assertValidName'; | ||
export { assertValidName } from "./assertValidName"; | ||
// Compares two GraphQLSchemas and detects breaking changes. | ||
export { findBreakingChanges } from './findBreakingChanges'; | ||
export { BreakingChange } from './findBreakingChanges'; | ||
export { findBreakingChanges } from "./findBreakingChanges"; | ||
export { BreakingChange } from "./findBreakingChanges"; | ||
// Report all deprecated usage within a GraphQL document. | ||
export { findDeprecatedUsages } from './findDeprecatedUsages'; | ||
export { findDeprecatedUsages } from "./findDeprecatedUsages"; |
@@ -1,2 +0,2 @@ | ||
import { DirectiveLocationEnum } from '../type/directives'; | ||
import { DirectiveLocationEnum } from "../type/directives"; | ||
@@ -99,112 +99,109 @@ /* | ||
export interface IntrospectionQuery { | ||
__schema: IntrospectionSchema; | ||
__schema: IntrospectionSchema; | ||
} | ||
export interface IntrospectionSchema { | ||
queryType: IntrospectionNamedTypeRef; | ||
mutationType?: IntrospectionNamedTypeRef; | ||
subscriptionType?: IntrospectionNamedTypeRef; | ||
types: IntrospectionType[]; | ||
directives: IntrospectionDirective[]; | ||
queryType: IntrospectionNamedTypeRef; | ||
mutationType?: IntrospectionNamedTypeRef; | ||
subscriptionType?: IntrospectionNamedTypeRef; | ||
types: IntrospectionType[]; | ||
directives: IntrospectionDirective[]; | ||
} | ||
export type IntrospectionType = | ||
| IntrospectionScalarType | ||
| IntrospectionObjectType | ||
| IntrospectionInterfaceType | ||
| IntrospectionUnionType | ||
| IntrospectionEnumType | ||
| IntrospectionInputObjectType; | ||
| IntrospectionScalarType | ||
| IntrospectionObjectType | ||
| IntrospectionInterfaceType | ||
| IntrospectionUnionType | ||
| IntrospectionEnumType | ||
| IntrospectionInputObjectType; | ||
export interface IntrospectionScalarType { | ||
kind: 'SCALAR'; | ||
name: string; | ||
description?: string; | ||
kind: "SCALAR"; | ||
name: string; | ||
description?: string; | ||
} | ||
export interface IntrospectionObjectType { | ||
kind: 'OBJECT'; | ||
name: string; | ||
description?: string; | ||
fields: IntrospectionField[]; | ||
interfaces: IntrospectionNamedTypeRef[]; | ||
kind: "OBJECT"; | ||
name: string; | ||
description?: string; | ||
fields: IntrospectionField[]; | ||
interfaces: IntrospectionNamedTypeRef[]; | ||
} | ||
export interface IntrospectionInterfaceType { | ||
kind: 'INTERFACE'; | ||
name: string; | ||
description?: string; | ||
fields: IntrospectionField[]; | ||
possibleTypes: IntrospectionNamedTypeRef[]; | ||
kind: "INTERFACE"; | ||
name: string; | ||
description?: string; | ||
fields: IntrospectionField[]; | ||
possibleTypes: IntrospectionNamedTypeRef[]; | ||
} | ||
export interface IntrospectionUnionType { | ||
kind: 'UNION'; | ||
name: string; | ||
description?: string; | ||
possibleTypes: IntrospectionNamedTypeRef[]; | ||
kind: "UNION"; | ||
name: string; | ||
description?: string; | ||
possibleTypes: IntrospectionNamedTypeRef[]; | ||
} | ||
export interface IntrospectionEnumType { | ||
kind: 'ENUM'; | ||
name: string; | ||
description?: string; | ||
enumValues: IntrospectionEnumValue[]; | ||
kind: "ENUM"; | ||
name: string; | ||
description?: string; | ||
enumValues: IntrospectionEnumValue[]; | ||
} | ||
export interface IntrospectionInputObjectType { | ||
kind: 'INPUT_OBJECT'; | ||
name: string; | ||
description?: string; | ||
inputFields: IntrospectionInputValue[]; | ||
kind: "INPUT_OBJECT"; | ||
name: string; | ||
description?: string; | ||
inputFields: IntrospectionInputValue[]; | ||
} | ||
export type IntrospectionTypeRef = | ||
| IntrospectionNamedTypeRef | ||
| IntrospectionListTypeRef | ||
| IntrospectionNonNullTypeRef; | ||
export type IntrospectionTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef; | ||
export interface IntrospectionNamedTypeRef { | ||
kind: string; | ||
name: string; | ||
kind: string; | ||
name: string; | ||
} | ||
export interface IntrospectionListTypeRef { | ||
kind: 'LIST'; | ||
ofType?: IntrospectionTypeRef; | ||
kind: "LIST"; | ||
ofType?: IntrospectionTypeRef; | ||
} | ||
export interface IntrospectionNonNullTypeRef { | ||
kind: 'NON_NULL'; | ||
ofType?: IntrospectionTypeRef; | ||
kind: "NON_NULL"; | ||
ofType?: IntrospectionTypeRef; | ||
} | ||
export interface IntrospectionField { | ||
name: string; | ||
description?: string; | ||
args: IntrospectionInputValue[]; | ||
type: IntrospectionTypeRef; | ||
isDeprecated: boolean; | ||
deprecationReason?: string; | ||
name: string; | ||
description?: string; | ||
args: IntrospectionInputValue[]; | ||
type: IntrospectionTypeRef; | ||
isDeprecated: boolean; | ||
deprecationReason?: string; | ||
} | ||
export interface IntrospectionInputValue { | ||
name: string; | ||
description?: string; | ||
type: IntrospectionTypeRef; | ||
defaultValue?: string; | ||
name: string; | ||
description?: string; | ||
type: IntrospectionTypeRef; | ||
defaultValue?: string; | ||
} | ||
export interface IntrospectionEnumValue { | ||
name: string; | ||
description?: string; | ||
isDeprecated: boolean; | ||
deprecationReason?: string; | ||
name: string; | ||
description?: string; | ||
isDeprecated: boolean; | ||
deprecationReason?: string; | ||
} | ||
export interface IntrospectionDirective { | ||
name: string; | ||
description?: string; | ||
locations: DirectiveLocationEnum[]; | ||
args: IntrospectionInputValue[]; | ||
name: string; | ||
description?: string; | ||
locations: DirectiveLocationEnum[]; | ||
args: IntrospectionInputValue[]; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { GraphQLInputType } from '../type/definition'; | ||
import { GraphQLInputType } from "../type/definition"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { ValueNode } from '../language/ast'; | ||
import { GraphQLInputType } from '../type/definition'; | ||
import { ValueNode } from "../language/ast"; | ||
import { GraphQLInputType } from "../type/definition"; | ||
@@ -11,5 +11,2 @@ /** | ||
*/ | ||
export function isValidLiteralValue( | ||
type: GraphQLInputType, | ||
valueNode: ValueNode, | ||
): string[]; | ||
export function isValidLiteralValue(type: GraphQLInputType, valueNode: ValueNode): string[]; |
@@ -1,6 +0,6 @@ | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { GraphQLType } from '../type/definition'; | ||
import { GraphQLSchema } from "../type/schema"; | ||
import { GraphQLType } from "../type/definition"; | ||
export interface PrinterOptions { | ||
commentDescriptions?: boolean; | ||
commentDescriptions?: boolean; | ||
} | ||
@@ -7,0 +7,0 @@ |
@@ -1,5 +0,3 @@ | ||
import { DocumentNode, OperationDefinitionNode } from '../language/ast'; | ||
import { DocumentNode, OperationDefinitionNode } from "../language/ast"; | ||
export function separateOperations( | ||
documentAST: DocumentNode, | ||
): { [operationName: string]: DocumentNode }; | ||
export function separateOperations(documentAST: DocumentNode): { [operationName: string]: DocumentNode }; |
@@ -1,7 +0,3 @@ | ||
import { | ||
GraphQLType, | ||
GraphQLCompositeType, | ||
GraphQLAbstractType, | ||
} from '../type/definition'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { GraphQLType, GraphQLCompositeType, GraphQLAbstractType } from "../type/definition"; | ||
import { GraphQLSchema } from "../type/schema"; | ||
@@ -17,7 +13,3 @@ /** | ||
*/ | ||
export function isTypeSubTypeOf( | ||
schema: GraphQLSchema, | ||
maybeSubType: GraphQLType, | ||
superType: GraphQLType, | ||
): boolean; | ||
export function isTypeSubTypeOf(schema: GraphQLSchema, maybeSubType: GraphQLType, superType: GraphQLType): boolean; | ||
@@ -34,5 +26,5 @@ /** | ||
export function doTypesOverlap( | ||
schema: GraphQLSchema, | ||
typeA: GraphQLCompositeType, | ||
typeB: GraphQLCompositeType, | ||
schema: GraphQLSchema, | ||
typeA: GraphQLCompositeType, | ||
typeB: GraphQLCompositeType | ||
): boolean; |
@@ -1,8 +0,5 @@ | ||
import { TypeNode } from '../language/ast'; | ||
import { GraphQLType, GraphQLNullableType } from '../type/definition'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { TypeNode } from "../language/ast"; | ||
import { GraphQLType, GraphQLNullableType } from "../type/definition"; | ||
import { GraphQLSchema } from "../type/schema"; | ||
export function typeFromAST( | ||
schema: GraphQLSchema, | ||
typeNode: TypeNode, | ||
): GraphQLType; | ||
export function typeFromAST(schema: GraphQLSchema, typeNode: TypeNode): GraphQLType; |
@@ -1,13 +0,13 @@ | ||
import { GraphQLSchema } from '../type/schema'; | ||
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'; | ||
GraphQLOutputType, | ||
GraphQLCompositeType, | ||
GraphQLInputType, | ||
GraphQLField, | ||
GraphQLArgument, | ||
GraphQLEnumValue, | ||
GraphQLType, | ||
} from "../type/definition"; | ||
import { GraphQLDirective } from "../type/directives"; | ||
import { ASTNode, FieldNode } from "../language/ast"; | ||
@@ -20,25 +20,25 @@ /** | ||
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, | ||
); | ||
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 | ||
); | ||
getType(): GraphQLOutputType; | ||
getParentType(): GraphQLCompositeType; | ||
getInputType(): GraphQLInputType; | ||
getFieldDef(): GraphQLField<any, any>; | ||
getDirective(): GraphQLDirective; | ||
getArgument(): GraphQLArgument; | ||
getEnumValue(): GraphQLEnumValue; | ||
enter(node: ASTNode): any; | ||
leave(node: ASTNode): any; | ||
getType(): GraphQLOutputType; | ||
getParentType(): GraphQLCompositeType; | ||
getInputType(): GraphQLInputType; | ||
getFieldDef(): GraphQLField<any, any>; | ||
getDirective(): GraphQLDirective; | ||
getArgument(): GraphQLArgument; | ||
getEnumValue(): GraphQLEnumValue; | ||
enter(node: ASTNode): any; | ||
leave(node: ASTNode): any; | ||
} | ||
export type getFieldDef = ( | ||
schema: GraphQLSchema, | ||
parentType: GraphQLType, | ||
fieldNode: FieldNode, | ||
schema: GraphQLSchema, | ||
parentType: GraphQLType, | ||
fieldNode: FieldNode | ||
) => GraphQLField<any, any>; |
@@ -1,15 +0,10 @@ | ||
import { GraphQLInputType } from '../type/definition'; | ||
import { | ||
ValueNode, | ||
VariableNode, | ||
ListValueNode, | ||
ObjectValueNode, | ||
} from '../language/ast'; | ||
import { GraphQLInputType } from "../type/definition"; | ||
import { ValueNode, VariableNode, ListValueNode, ObjectValueNode } from "../language/ast"; | ||
export function valueFromAST( | ||
valueNode: ValueNode, | ||
type: GraphQLInputType, | ||
variables?: { | ||
[key: string]: any; | ||
}, | ||
valueNode: ValueNode, | ||
type: GraphQLInputType, | ||
variables?: { | ||
[key: string]: any; | ||
} | ||
): any; |
@@ -1,128 +0,80 @@ | ||
export { validate, ValidationContext } from './validate'; | ||
export { specifiedRules } from './specifiedRules'; | ||
export { validate, ValidationContext } from "./validate"; | ||
export { specifiedRules } from "./specifiedRules"; | ||
// Spec Section: "Argument Values Type Correctness" | ||
export { | ||
ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule, | ||
} from './rules/ArgumentsOfCorrectType'; | ||
export { ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule } from "./rules/ArgumentsOfCorrectType"; | ||
// Spec Section: "Variable Default Values Are Correctly Typed" | ||
export { | ||
DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule, | ||
} from './rules/DefaultValuesOfCorrectType'; | ||
export { DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule } from "./rules/DefaultValuesOfCorrectType"; | ||
// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" | ||
export { | ||
FieldsOnCorrectType as FieldsOnCorrectTypeRule, | ||
} from './rules/FieldsOnCorrectType'; | ||
export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectType"; | ||
// Spec Section: "Fragments on Composite Types" | ||
export { | ||
FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, | ||
} from './rules/FragmentsOnCompositeTypes'; | ||
export { FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypes"; | ||
// Spec Section: "Argument Names" | ||
export { | ||
KnownArgumentNames as KnownArgumentNamesRule, | ||
} from './rules/KnownArgumentNames'; | ||
export { KnownArgumentNames as KnownArgumentNamesRule } from "./rules/KnownArgumentNames"; | ||
// Spec Section: "Directives Are Defined" | ||
export { | ||
KnownDirectives as KnownDirectivesRule, | ||
} from './rules/KnownDirectives'; | ||
export { KnownDirectives as KnownDirectivesRule } from "./rules/KnownDirectives"; | ||
// Spec Section: "Fragment spread target defined" | ||
export { | ||
KnownFragmentNames as KnownFragmentNamesRule, | ||
} from './rules/KnownFragmentNames'; | ||
export { KnownFragmentNames as KnownFragmentNamesRule } from "./rules/KnownFragmentNames"; | ||
// Spec Section: "Fragment Spread Type Existence" | ||
export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; | ||
export { KnownTypeNames as KnownTypeNamesRule } from "./rules/KnownTypeNames"; | ||
// Spec Section: "Lone Anonymous Operation" | ||
export { | ||
LoneAnonymousOperation as LoneAnonymousOperationRule, | ||
} from './rules/LoneAnonymousOperation'; | ||
export { LoneAnonymousOperation as LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperation"; | ||
// Spec Section: "Fragments must not form cycles" | ||
export { | ||
NoFragmentCycles as NoFragmentCyclesRule, | ||
} from './rules/NoFragmentCycles'; | ||
export { NoFragmentCycles as NoFragmentCyclesRule } from "./rules/NoFragmentCycles"; | ||
// Spec Section: "All Variable Used Defined" | ||
export { | ||
NoUndefinedVariables as NoUndefinedVariablesRule, | ||
} from './rules/NoUndefinedVariables'; | ||
export { NoUndefinedVariables as NoUndefinedVariablesRule } from "./rules/NoUndefinedVariables"; | ||
// Spec Section: "Fragments must be used" | ||
export { | ||
NoUnusedFragments as NoUnusedFragmentsRule, | ||
} from './rules/NoUnusedFragments'; | ||
export { NoUnusedFragments as NoUnusedFragmentsRule } from "./rules/NoUnusedFragments"; | ||
// Spec Section: "All Variables Used" | ||
export { | ||
NoUnusedVariables as NoUnusedVariablesRule, | ||
} from './rules/NoUnusedVariables'; | ||
export { NoUnusedVariables as NoUnusedVariablesRule } from "./rules/NoUnusedVariables"; | ||
// Spec Section: "Field Selection Merging" | ||
export { | ||
OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, | ||
} from './rules/OverlappingFieldsCanBeMerged'; | ||
export { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMerged"; | ||
// Spec Section: "Fragment spread is possible" | ||
export { | ||
PossibleFragmentSpreads as PossibleFragmentSpreadsRule, | ||
} from './rules/PossibleFragmentSpreads'; | ||
export { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreads"; | ||
// Spec Section: "Argument Optionality" | ||
export { | ||
ProvidedNonNullArguments as ProvidedNonNullArgumentsRule, | ||
} from './rules/ProvidedNonNullArguments'; | ||
export { ProvidedNonNullArguments as ProvidedNonNullArgumentsRule } from "./rules/ProvidedNonNullArguments"; | ||
// Spec Section: "Leaf Field Selections" | ||
export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; | ||
export { ScalarLeafs as ScalarLeafsRule } from "./rules/ScalarLeafs"; | ||
// Spec Section: "Subscriptions with Single Root Field" | ||
export { | ||
SingleFieldSubscriptions as SingleFieldSubscriptionsRule, | ||
} from './rules/SingleFieldSubscriptions'; | ||
export { SingleFieldSubscriptions as SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptions"; | ||
// Spec Section: "Argument Uniqueness" | ||
export { | ||
UniqueArgumentNames as UniqueArgumentNamesRule, | ||
} from './rules/UniqueArgumentNames'; | ||
export { UniqueArgumentNames as UniqueArgumentNamesRule } from "./rules/UniqueArgumentNames"; | ||
// Spec Section: "Directives Are Unique Per Location" | ||
export { | ||
UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, | ||
} from './rules/UniqueDirectivesPerLocation'; | ||
export { UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocation"; | ||
// Spec Section: "Fragment Name Uniqueness" | ||
export { | ||
UniqueFragmentNames as UniqueFragmentNamesRule, | ||
} from './rules/UniqueFragmentNames'; | ||
export { UniqueFragmentNames as UniqueFragmentNamesRule } from "./rules/UniqueFragmentNames"; | ||
// Spec Section: "Input Object Field Uniqueness" | ||
export { | ||
UniqueInputFieldNames as UniqueInputFieldNamesRule, | ||
} from './rules/UniqueInputFieldNames'; | ||
export { UniqueInputFieldNames as UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNames"; | ||
// Spec Section: "Operation Name Uniqueness" | ||
export { | ||
UniqueOperationNames as UniqueOperationNamesRule, | ||
} from './rules/UniqueOperationNames'; | ||
export { UniqueOperationNames as UniqueOperationNamesRule } from "./rules/UniqueOperationNames"; | ||
// Spec Section: "Variable Uniqueness" | ||
export { | ||
UniqueVariableNames as UniqueVariableNamesRule, | ||
} from './rules/UniqueVariableNames'; | ||
export { UniqueVariableNames as UniqueVariableNamesRule } from "./rules/UniqueVariableNames"; | ||
// Spec Section: "Variables are Input Types" | ||
export { | ||
VariablesAreInputTypes as VariablesAreInputTypesRule, | ||
} from './rules/VariablesAreInputTypes'; | ||
export { VariablesAreInputTypes as VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypes"; | ||
// Spec Section: "All Variable Usages Are Allowed" | ||
export { | ||
VariablesInAllowedPosition as VariablesInAllowedPositionRule, | ||
} from './rules/VariablesInAllowedPosition'; | ||
export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPosition"; |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
export function NoFragmentCycles(context: ValidationContext): any; |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from '../index'; | ||
import { ValidationContext } from "../index"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ValidationContext } from './validate'; // It needs to check. | ||
import { ValidationContext } from "./validate"; // It needs to check. | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,21 +0,21 @@ | ||
import { GraphQLError } from '../error'; | ||
import { GraphQLError } from "../error"; | ||
import { | ||
DocumentNode, | ||
OperationDefinitionNode, | ||
VariableNode, | ||
SelectionSetNode, | ||
FragmentSpreadNode, | ||
FragmentDefinitionNode, | ||
} from '../language/ast'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
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 { specifiedRules } from './specifiedRules'; | ||
GraphQLInputType, | ||
GraphQLOutputType, | ||
GraphQLCompositeType, | ||
GraphQLField, | ||
GraphQLArgument, | ||
} from "../type/definition"; | ||
import { GraphQLDirective } from "../type/directives"; | ||
import { TypeInfo } from "../utilities/TypeInfo"; | ||
import { specifiedRules } from "./specifiedRules"; | ||
@@ -35,7 +35,3 @@ /** | ||
*/ | ||
export function validate( | ||
schema: GraphQLSchema, | ||
ast: DocumentNode, | ||
rules?: any[], | ||
): GraphQLError[]; | ||
export function validate(schema: GraphQLSchema, ast: DocumentNode, rules?: any[]): GraphQLError[]; | ||
@@ -49,14 +45,12 @@ /** | ||
export function visitUsingRules( | ||
schema: GraphQLSchema, | ||
typeInfo: TypeInfo, | ||
documentAST: DocumentNode, | ||
rules: any[], | ||
schema: GraphQLSchema, | ||
typeInfo: TypeInfo, | ||
documentAST: DocumentNode, | ||
rules: any[] | ||
): GraphQLError[]; | ||
export type NodeWithSelectionSet = | ||
| OperationDefinitionNode | ||
| FragmentDefinitionNode; | ||
export type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; | ||
export interface VariableUsage { | ||
node: VariableNode; | ||
type: GraphQLInputType; | ||
node: VariableNode; | ||
type: GraphQLInputType; | ||
} | ||
@@ -70,36 +64,32 @@ | ||
export class ValidationContext { | ||
constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); | ||
reportError(error: GraphQLError): void; | ||
constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); | ||
reportError(error: GraphQLError): void; | ||
getErrors(): GraphQLError[]; | ||
getErrors(): GraphQLError[]; | ||
getSchema(): GraphQLSchema; | ||
getSchema(): GraphQLSchema; | ||
getDocument(): DocumentNode; | ||
getDocument(): DocumentNode; | ||
getFragment(name: string): FragmentDefinitionNode; | ||
getFragment(name: string): FragmentDefinitionNode; | ||
getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; | ||
getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; | ||
getRecursivelyReferencedFragments( | ||
operation: OperationDefinitionNode, | ||
): FragmentDefinitionNode[]; | ||
getRecursivelyReferencedFragments(operation: OperationDefinitionNode): FragmentDefinitionNode[]; | ||
getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; | ||
getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; | ||
getRecursiveVariableUsages( | ||
operation: OperationDefinitionNode, | ||
): VariableUsage[]; | ||
getRecursiveVariableUsages(operation: OperationDefinitionNode): VariableUsage[]; | ||
getType(): GraphQLOutputType; | ||
getType(): GraphQLOutputType; | ||
getParentType(): GraphQLCompositeType; | ||
getParentType(): GraphQLCompositeType; | ||
getInputType(): GraphQLInputType; | ||
getInputType(): GraphQLInputType; | ||
getFieldDef(): GraphQLField<any, any>; | ||
getFieldDef(): GraphQLField<any, any>; | ||
getDirective(): GraphQLDirective; | ||
getDirective(): GraphQLDirective; | ||
getArgument(): GraphQLArgument; | ||
getArgument(): GraphQLArgument; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100713
2819