@types/graphql
Advanced tools
Comparing version 0.12.1 to 0.12.2
@@ -10,10 +10,10 @@ import { GraphQLError } from './GraphQLError'; | ||
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; | ||
} |
@@ -12,58 +12,58 @@ import { getLocation } from '../language'; | ||
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; | ||
/** | ||
* 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, | ||
); | ||
constructor( | ||
message: string, | ||
nodes?: any[], | ||
source?: Source, | ||
positions?: number[], | ||
path?: Array<string | number>, | ||
originalError?: Error, | ||
); | ||
} |
export { GraphQLError } from './GraphQLError'; | ||
export { syntaxError } from './syntaxError'; | ||
export { locatedError } from './locatedError'; | ||
export { formatError, GraphQLFormattedError, GraphQLErrorLocation } from './formatError'; | ||
export { | ||
formatError, | ||
GraphQLFormattedError, | ||
GraphQLErrorLocation, | ||
} from './formatError'; |
@@ -9,5 +9,5 @@ import { GraphQLError } from './GraphQLError'; | ||
export function locatedError<T>( | ||
originalError: Error, | ||
nodes: T[], | ||
path: Array<string | number> | ||
originalError: Error, | ||
nodes: T[], | ||
path: Array<string | number>, | ||
): GraphQLError; |
@@ -9,5 +9,5 @@ import { Source } from '../language/source'; | ||
export function syntaxError( | ||
source: Source, | ||
position: number, | ||
description: string | ||
source: Source, | ||
position: number, | ||
description: string, | ||
): GraphQLError; |
import { GraphQLError, locatedError } from '../error'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { GraphQLField, GraphQLFieldResolver, ResponsePath } from '../type/definition'; | ||
import { | ||
DirectiveNode, | ||
DocumentNode, | ||
OperationDefinitionNode, | ||
SelectionSetNode, | ||
FieldNode, | ||
InlineFragmentNode, | ||
FragmentDefinitionNode, | ||
GraphQLField, | ||
GraphQLFieldResolver, | ||
ResponsePath, | ||
} from '../type/definition'; | ||
import { | ||
DirectiveNode, | ||
DocumentNode, | ||
OperationDefinitionNode, | ||
SelectionSetNode, | ||
FieldNode, | ||
InlineFragmentNode, | ||
FragmentDefinitionNode, | ||
} from '../language/ast'; | ||
@@ -20,9 +24,9 @@ /** | ||
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[]; | ||
} | ||
@@ -37,15 +41,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>; | ||
}; | ||
@@ -65,11 +69,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>; | ||
@@ -81,5 +85,3 @@ | ||
*/ | ||
export function responsePathAsArray( | ||
path: ResponsePath | ||
): Array<string | number>; | ||
export function responsePathAsArray(path: ResponsePath): Array<string | number>; | ||
@@ -86,0 +88,0 @@ export function addPath(prev: ResponsePath, key: string | number): any; |
export { | ||
execute, | ||
defaultFieldResolver, | ||
responsePathAsArray, | ||
ExecutionArgs, | ||
ExecutionResult | ||
execute, | ||
defaultFieldResolver, | ||
responsePathAsArray, | ||
ExecutionArgs, | ||
ExecutionResult, | ||
} from './execute'; | ||
export { getDirectiveValues } from './values'; |
@@ -1,5 +0,13 @@ | ||
import { GraphQLInputType, GraphQLField, GraphQLArgument } from '../type/definition'; | ||
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 { | ||
FieldNode, | ||
DirectiveNode, | ||
VariableDefinitionNode, | ||
} from '../language/ast'; | ||
@@ -12,5 +20,5 @@ /** | ||
export function getVariableValues( | ||
schema: GraphQLSchema, | ||
varDefNodes: VariableDefinitionNode[], | ||
inputs: { [key: string]: any } | ||
schema: GraphQLSchema, | ||
varDefNodes: VariableDefinitionNode[], | ||
inputs: { [key: string]: any }, | ||
): { [key: string]: any }; | ||
@@ -23,5 +31,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 }; | ||
@@ -37,5 +45,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 }; |
@@ -8,26 +8,26 @@ import { Source } from './source'; | ||
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,5 +218,5 @@ | ||
export interface DocumentNode { | ||
kind: 'Document'; | ||
loc?: Location; | ||
definitions: DefinitionNode[]; | ||
kind: 'Document'; | ||
loc?: Location; | ||
definitions: DefinitionNode[]; | ||
} | ||
@@ -233,9 +233,9 @@ | ||
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; | ||
} | ||
@@ -247,41 +247,38 @@ | ||
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[]; | ||
} | ||
export type SelectionNode = | ||
| FieldNode | ||
| FragmentSpreadNode | ||
| InlineFragmentNode; | ||
export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; | ||
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; | ||
} | ||
@@ -292,26 +289,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; | ||
} | ||
@@ -322,64 +319,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; | ||
} | ||
@@ -390,6 +387,6 @@ | ||
export interface DirectiveNode { | ||
kind: 'Directive'; | ||
loc?: Location; | ||
name: NameNode; | ||
arguments?: ArgumentNode[]; | ||
kind: 'Directive'; | ||
loc?: Location; | ||
name: NameNode; | ||
arguments?: ArgumentNode[]; | ||
} | ||
@@ -399,23 +396,20 @@ | ||
export type TypeNode = | ||
| NamedTypeNode | ||
| ListTypeNode | ||
| NonNullTypeNode; | ||
export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; | ||
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; | ||
} | ||
@@ -426,109 +420,109 @@ | ||
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[]; | ||
} | ||
@@ -545,47 +539,47 @@ | ||
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[]; | ||
}; | ||
@@ -596,8 +590,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[]; | ||
} |
@@ -10,7 +10,7 @@ export * from './ast'; | ||
export { | ||
visit, | ||
visitInParallel, | ||
visitWithTypeInfo, | ||
getVisitFn, | ||
BREAK | ||
visit, | ||
visitInParallel, | ||
visitWithTypeInfo, | ||
getVisitFn, | ||
BREAK, | ||
} from './visitor'; |
@@ -14,4 +14,4 @@ import { Token } from './ast'; | ||
export function createLexer<TOptions>( | ||
source: Source, | ||
options: TOptions | ||
source: Source, | ||
options: TOptions, | ||
): Lexer<TOptions>; | ||
@@ -23,29 +23,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 +58,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 +80,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,8 +9,8 @@ /** | ||
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; | ||
} | ||
@@ -23,4 +23,4 @@ | ||
export function parse( | ||
source: string | Source, | ||
options?: ParseOptions | ||
source: string | Source, | ||
options?: ParseOptions, | ||
): DocumentNode; | ||
@@ -36,4 +36,4 @@ | ||
export function parseValue( | ||
source: Source | string, | ||
options?: ParseOptions | ||
source: Source | string, | ||
options?: ParseOptions, | ||
): ValueNode; | ||
@@ -40,0 +40,0 @@ |
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.1", | ||
"version": "0.12.2", | ||
"description": "TypeScript definitions for graphql", | ||
@@ -75,4 +75,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "9b357224368bb743e5292262ee6c43403cd854f38b06e991dedf0dc56b82739f", | ||
"typesPublisherContentHash": "6104419bbdb0699993b5f1d1c9b4bcc6413a7965d632c29eeca3c616e59a2155", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Thu, 18 Jan 2018 23:56:37 GMT | ||
* Last updated: Wed, 24 Jan 2018 18:35:42 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
@@ -7,24 +7,24 @@ import { GraphQLSchema } from '../type/schema'; | ||
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, | ||
ScalarTypeDefinitionNode, | ||
ObjectTypeDefinitionNode, | ||
FieldDefinitionNode, | ||
InputValueDefinitionNode, | ||
InterfaceTypeDefinitionNode, | ||
UnionTypeDefinitionNode, | ||
EnumTypeDefinitionNode, | ||
EnumValueDefinitionNode, | ||
InputObjectTypeDefinitionNode, | ||
TypeExtensionNode, | ||
OperationDefinitionNode, | ||
FieldNode, | ||
FragmentDefinitionNode, | ||
ValueNode, | ||
} from '../language/ast'; | ||
@@ -23,10 +23,10 @@ import { GraphQLSchema } from './schema'; | ||
export type GraphQLType = | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any> | ||
| GraphQLNonNull<any>; | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any> | ||
| GraphQLNonNull<any>; | ||
@@ -41,11 +41,12 @@ 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> | ||
>; | ||
@@ -60,15 +61,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> | ||
>; | ||
@@ -82,5 +84,3 @@ export function isOutputType(type: GraphQLType): type is GraphQLOutputType; | ||
*/ | ||
export type GraphQLLeafType = | ||
| GraphQLScalarType | ||
| GraphQLEnumType; | ||
export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; | ||
@@ -95,7 +95,9 @@ export function isLeafType(type: GraphQLType): type is GraphQLLeafType; | ||
export type GraphQLCompositeType = | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType; | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType; | ||
export function isCompositeType(type: GraphQLType): type is GraphQLCompositeType; | ||
export function isCompositeType( | ||
type: GraphQLType, | ||
): type is GraphQLCompositeType; | ||
@@ -107,5 +109,3 @@ export function assertCompositeType(type: GraphQLType): GraphQLCompositeType; | ||
*/ | ||
export type GraphQLAbstractType = | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType; | ||
export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; | ||
@@ -120,13 +120,13 @@ export function isAbstractType(type: GraphQLType): type is GraphQLAbstractType; | ||
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); | ||
type: T, | ||
): T & GraphQLNullableType; | ||
@@ -137,8 +137,8 @@ /** | ||
export type GraphQLNamedType = | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType; | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType; | ||
@@ -175,26 +175,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; | ||
} | ||
@@ -240,105 +240,119 @@ | ||
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>; | ||
} | ||
@@ -365,25 +379,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; | ||
} | ||
@@ -415,25 +429,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; | ||
} | ||
@@ -463,41 +477,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; | ||
} | ||
@@ -526,38 +540,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; | ||
} | ||
@@ -584,5 +598,5 @@ | ||
export class GraphQLList<T extends GraphQLType> { | ||
ofType: T; | ||
constructor(type: T); | ||
toString(): string; | ||
ofType: T; | ||
constructor(type: T); | ||
toString(): string; | ||
} | ||
@@ -611,7 +625,7 @@ | ||
export class GraphQLNonNull<T extends GraphQLNullableType> { | ||
ofType: T; | ||
ofType: T; | ||
constructor(type: T); | ||
constructor(type: T); | ||
toString(): string; | ||
toString(): string; | ||
} |
@@ -1,28 +0,25 @@ | ||
import { | ||
GraphQLFieldConfigArgumentMap, | ||
GraphQLArgument | ||
} from './definition'; | ||
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'; | ||
}; | ||
@@ -37,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; | ||
} | ||
@@ -54,0 +51,0 @@ |
@@ -7,16 +7,13 @@ // GraphQL Schema 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, | ||
// "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'; | ||
@@ -26,29 +23,27 @@ | ||
export { | ||
GraphQLInt, | ||
GraphQLFloat, | ||
GraphQLString, | ||
GraphQLBoolean, | ||
GraphQLID, | ||
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, | ||
// "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'; |
import { | ||
GraphQLScalarType, | ||
GraphQLObjectType, | ||
GraphQLInterfaceType, | ||
GraphQLUnionType, | ||
GraphQLEnumType, | ||
GraphQLInputObjectType, | ||
GraphQLList, | ||
GraphQLNonNull, | ||
GraphQLScalarType, | ||
GraphQLObjectType, | ||
GraphQLInterfaceType, | ||
GraphQLUnionType, | ||
GraphQLEnumType, | ||
GraphQLInputObjectType, | ||
GraphQLList, | ||
GraphQLNonNull, | ||
} from './definition'; | ||
@@ -22,10 +22,10 @@ import { GraphQLField } from './definition'; | ||
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 @@ |
@@ -0,15 +1,9 @@ | ||
import { GraphQLObjectType } from './definition'; | ||
import { | ||
GraphQLObjectType, | ||
GraphQLType, | ||
GraphQLNamedType, | ||
GraphQLAbstractType, | ||
} from './definition'; | ||
import { | ||
GraphQLType, | ||
GraphQLNamedType, | ||
GraphQLAbstractType | ||
} from './definition'; | ||
import { | ||
SchemaDefinitionNode | ||
} from '../language/ast'; | ||
import { | ||
GraphQLDirective, | ||
} from './directives'; | ||
import { SchemaDefinitionNode } from '../language/ast'; | ||
import { GraphQLDirective } from './directives'; | ||
@@ -43,36 +37,36 @@ /** | ||
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 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: | ||
@@ -33,5 +33,2 @@ IntValueNode, | ||
// TODO: this should set overloads according to above the table | ||
export function astFromValue( | ||
value: any, | ||
type: GraphQLInputType | ||
): ValueNode; // Warning: there is a code in bottom: throw new TypeError | ||
export function astFromValue(value: any, type: GraphQLInputType): ValueNode; // Warning: there is a code in bottom: throw new TypeError |
@@ -14,3 +14,3 @@ import { IntrospectionQuery } from './introspectionQuery'; | ||
export function buildClientSchema( | ||
introspection: IntrospectionQuery | ||
introspection: IntrospectionQuery, | ||
): GraphQLSchema; |
@@ -17,4 +17,4 @@ import { DocumentNode } from '../language/ast'; | ||
export function extendSchema( | ||
schema: GraphQLSchema, | ||
documentAST: DocumentNode | ||
schema: GraphQLSchema, | ||
documentAST: DocumentNode, | ||
): GraphQLSchema; |
import { | ||
getNamedType, | ||
GraphQLScalarType, | ||
GraphQLEnumType, | ||
GraphQLInputObjectType, | ||
GraphQLInterfaceType, | ||
GraphQLObjectType, | ||
GraphQLUnionType, | ||
GraphQLNamedType, | ||
getNamedType, | ||
GraphQLScalarType, | ||
GraphQLEnumType, | ||
GraphQLInputObjectType, | ||
GraphQLInterfaceType, | ||
GraphQLObjectType, | ||
GraphQLUnionType, | ||
GraphQLNamedType, | ||
} from '../type/definition'; | ||
@@ -14,21 +14,21 @@ 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; | ||
} | ||
@@ -41,4 +41,4 @@ | ||
export function findBreakingChanges( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
@@ -51,4 +51,4 @@ | ||
export function findRemovedTypes( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
@@ -61,4 +61,4 @@ | ||
export function findTypesThatChangedKind( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
@@ -72,4 +72,4 @@ | ||
export function findFieldsThatChangedType( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
@@ -82,4 +82,4 @@ | ||
export function findTypesRemovedFromUnions( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; | ||
@@ -92,4 +92,4 @@ | ||
export function findValuesRemovedFromEnums( | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema | ||
oldSchema: GraphQLSchema, | ||
newSchema: GraphQLSchema, | ||
): BreakingChange[]; |
@@ -11,4 +11,4 @@ import { GraphQLSchema } from '../type/schema'; | ||
export function findDeprecatedUsages( | ||
schema: GraphQLSchema, | ||
ast: DocumentNode | ||
schema: GraphQLSchema, | ||
ast: DocumentNode, | ||
): GraphQLError[]; |
@@ -9,4 +9,4 @@ import { DocumentNode, OperationDefinitionNode } from '../language/ast'; | ||
export function getOperationAST( | ||
documentAST: DocumentNode, | ||
operationName?: string | ||
documentAST: DocumentNode, | ||
operationName?: string, | ||
): OperationDefinitionNode; |
// The GraphQL query recommended for a full schema introspection. | ||
export { introspectionQuery } from './introspectionQuery'; | ||
export { | ||
IntrospectionQuery, | ||
IntrospectionSchema, | ||
IntrospectionType, | ||
IntrospectionScalarType, | ||
IntrospectionObjectType, | ||
IntrospectionInterfaceType, | ||
IntrospectionUnionType, | ||
IntrospectionEnumType, | ||
IntrospectionInputObjectType, | ||
IntrospectionTypeRef, | ||
IntrospectionNamedTypeRef, | ||
IntrospectionListTypeRef, | ||
IntrospectionNonNullTypeRef, | ||
IntrospectionField, | ||
IntrospectionInputValue, | ||
IntrospectionEnumValue, | ||
IntrospectionDirective, | ||
IntrospectionQuery, | ||
IntrospectionSchema, | ||
IntrospectionType, | ||
IntrospectionScalarType, | ||
IntrospectionObjectType, | ||
IntrospectionInterfaceType, | ||
IntrospectionUnionType, | ||
IntrospectionEnumType, | ||
IntrospectionInputObjectType, | ||
IntrospectionTypeRef, | ||
IntrospectionNamedTypeRef, | ||
IntrospectionListTypeRef, | ||
IntrospectionNonNullTypeRef, | ||
IntrospectionField, | ||
IntrospectionInputValue, | ||
IntrospectionEnumValue, | ||
IntrospectionDirective, | ||
} from './introspectionQuery'; | ||
@@ -36,3 +36,7 @@ | ||
// Print a GraphQLSchema to GraphQL Schema language. | ||
export { printSchema, printType, printIntrospectionSchema } from './schemaPrinter'; | ||
export { | ||
printSchema, | ||
printType, | ||
printIntrospectionSchema, | ||
} from './schemaPrinter'; | ||
@@ -66,5 +70,5 @@ // Create a GraphQLType from a GraphQL language AST. | ||
export { | ||
isEqualType, | ||
isTypeSubTypeOf, | ||
doTypesOverlap | ||
isEqualType, | ||
isTypeSubTypeOf, | ||
doTypesOverlap, | ||
} from './typeComparators'; | ||
@@ -71,0 +75,0 @@ |
@@ -99,112 +99,112 @@ import { DirectiveLocationEnum } from '../type/directives'; | ||
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; | ||
| 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[]; | ||
} |
@@ -8,5 +8,2 @@ import { GraphQLInputType } from '../type/definition'; | ||
*/ | ||
export function isValidJSValue( | ||
value: any, | ||
type: GraphQLInputType | ||
): string[]; | ||
export function isValidJSValue(value: any, type: GraphQLInputType): string[]; |
@@ -12,4 +12,4 @@ import { ValueNode } from '../language/ast'; | ||
export function isValidLiteralValue( | ||
type: GraphQLInputType, | ||
valueNode: ValueNode | ||
type: GraphQLInputType, | ||
valueNode: ValueNode, | ||
): string[]; |
@@ -1,8 +0,5 @@ | ||
import { | ||
DocumentNode, | ||
OperationDefinitionNode, | ||
} from '../language/ast'; | ||
import { DocumentNode, OperationDefinitionNode } from '../language/ast'; | ||
export function separateOperations( | ||
documentAST: DocumentNode | ||
documentAST: DocumentNode, | ||
): { [operationName: string]: DocumentNode }; |
import { | ||
GraphQLType, | ||
GraphQLCompositeType, | ||
GraphQLAbstractType | ||
GraphQLType, | ||
GraphQLCompositeType, | ||
GraphQLAbstractType, | ||
} from '../type/definition'; | ||
import { | ||
GraphQLSchema | ||
} from '../type/schema'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
@@ -20,5 +18,5 @@ /** | ||
export function isTypeSubTypeOf( | ||
schema: GraphQLSchema, | ||
maybeSubType: GraphQLType, | ||
superType: GraphQLType | ||
schema: GraphQLSchema, | ||
maybeSubType: GraphQLType, | ||
superType: GraphQLType, | ||
): boolean; | ||
@@ -36,5 +34,5 @@ | ||
export function doTypesOverlap( | ||
schema: GraphQLSchema, | ||
typeA: GraphQLCompositeType, | ||
typeB: GraphQLCompositeType | ||
schema: GraphQLSchema, | ||
typeA: GraphQLCompositeType, | ||
typeB: GraphQLCompositeType, | ||
): boolean; |
@@ -6,4 +6,4 @@ import { TypeNode } from '../language/ast'; | ||
export function typeFromAST( | ||
schema: GraphQLSchema, | ||
typeNode: TypeNode | ||
schema: GraphQLSchema, | ||
typeNode: TypeNode, | ||
): GraphQLType; |
import { GraphQLSchema } from '../type/schema'; | ||
import { | ||
GraphQLOutputType, | ||
GraphQLCompositeType, | ||
GraphQLInputType, | ||
GraphQLField, | ||
GraphQLArgument, | ||
GraphQLEnumValue, | ||
GraphQLType, | ||
GraphQLOutputType, | ||
GraphQLCompositeType, | ||
GraphQLInputType, | ||
GraphQLField, | ||
GraphQLArgument, | ||
GraphQLEnumValue, | ||
GraphQLType, | ||
} from '../type/definition'; | ||
@@ -20,25 +20,25 @@ import { GraphQLDirective } from '../type/directives'; | ||
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>; |
import { GraphQLInputType } from '../type/definition'; | ||
import { | ||
ValueNode, | ||
VariableNode, | ||
ListValueNode, | ||
ObjectValueNode | ||
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; |
@@ -6,3 +6,3 @@ export { validate, ValidationContext } from './validate'; | ||
export { | ||
ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule | ||
ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule, | ||
} from './rules/ArgumentsOfCorrectType'; | ||
@@ -12,3 +12,3 @@ | ||
export { | ||
DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule | ||
DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule, | ||
} from './rules/DefaultValuesOfCorrectType'; | ||
@@ -18,3 +18,3 @@ | ||
export { | ||
FieldsOnCorrectType as FieldsOnCorrectTypeRule | ||
FieldsOnCorrectType as FieldsOnCorrectTypeRule, | ||
} from './rules/FieldsOnCorrectType'; | ||
@@ -24,3 +24,3 @@ | ||
export { | ||
FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule | ||
FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, | ||
} from './rules/FragmentsOnCompositeTypes'; | ||
@@ -30,3 +30,3 @@ | ||
export { | ||
KnownArgumentNames as KnownArgumentNamesRule | ||
KnownArgumentNames as KnownArgumentNamesRule, | ||
} from './rules/KnownArgumentNames'; | ||
@@ -36,3 +36,3 @@ | ||
export { | ||
KnownDirectives as KnownDirectivesRule | ||
KnownDirectives as KnownDirectivesRule, | ||
} from './rules/KnownDirectives'; | ||
@@ -42,13 +42,11 @@ | ||
export { | ||
KnownFragmentNames as KnownFragmentNamesRule | ||
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 | ||
LoneAnonymousOperation as LoneAnonymousOperationRule, | ||
} from './rules/LoneAnonymousOperation'; | ||
@@ -58,3 +56,3 @@ | ||
export { | ||
NoFragmentCycles as NoFragmentCyclesRule | ||
NoFragmentCycles as NoFragmentCyclesRule, | ||
} from './rules/NoFragmentCycles'; | ||
@@ -64,3 +62,3 @@ | ||
export { | ||
NoUndefinedVariables as NoUndefinedVariablesRule | ||
NoUndefinedVariables as NoUndefinedVariablesRule, | ||
} from './rules/NoUndefinedVariables'; | ||
@@ -70,3 +68,3 @@ | ||
export { | ||
NoUnusedFragments as NoUnusedFragmentsRule | ||
NoUnusedFragments as NoUnusedFragmentsRule, | ||
} from './rules/NoUnusedFragments'; | ||
@@ -76,3 +74,3 @@ | ||
export { | ||
NoUnusedVariables as NoUnusedVariablesRule | ||
NoUnusedVariables as NoUnusedVariablesRule, | ||
} from './rules/NoUnusedVariables'; | ||
@@ -82,3 +80,3 @@ | ||
export { | ||
OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule | ||
OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, | ||
} from './rules/OverlappingFieldsCanBeMerged'; | ||
@@ -88,3 +86,3 @@ | ||
export { | ||
PossibleFragmentSpreads as PossibleFragmentSpreadsRule | ||
PossibleFragmentSpreads as PossibleFragmentSpreadsRule, | ||
} from './rules/PossibleFragmentSpreads'; | ||
@@ -94,13 +92,11 @@ | ||
export { | ||
ProvidedNonNullArguments as ProvidedNonNullArgumentsRule | ||
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 | ||
SingleFieldSubscriptions as SingleFieldSubscriptionsRule, | ||
} from './rules/SingleFieldSubscriptions'; | ||
@@ -110,3 +106,3 @@ | ||
export { | ||
UniqueArgumentNames as UniqueArgumentNamesRule | ||
UniqueArgumentNames as UniqueArgumentNamesRule, | ||
} from './rules/UniqueArgumentNames'; | ||
@@ -116,3 +112,3 @@ | ||
export { | ||
UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule | ||
UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, | ||
} from './rules/UniqueDirectivesPerLocation'; | ||
@@ -122,3 +118,3 @@ | ||
export { | ||
UniqueFragmentNames as UniqueFragmentNamesRule | ||
UniqueFragmentNames as UniqueFragmentNamesRule, | ||
} from './rules/UniqueFragmentNames'; | ||
@@ -128,3 +124,3 @@ | ||
export { | ||
UniqueInputFieldNames as UniqueInputFieldNamesRule | ||
UniqueInputFieldNames as UniqueInputFieldNamesRule, | ||
} from './rules/UniqueInputFieldNames'; | ||
@@ -134,3 +130,3 @@ | ||
export { | ||
UniqueOperationNames as UniqueOperationNamesRule | ||
UniqueOperationNames as UniqueOperationNamesRule, | ||
} from './rules/UniqueOperationNames'; | ||
@@ -140,3 +136,3 @@ | ||
export { | ||
UniqueVariableNames as UniqueVariableNamesRule | ||
UniqueVariableNames as UniqueVariableNamesRule, | ||
} from './rules/UniqueVariableNames'; | ||
@@ -146,3 +142,3 @@ | ||
export { | ||
VariablesAreInputTypes as VariablesAreInputTypesRule | ||
VariablesAreInputTypes as VariablesAreInputTypesRule, | ||
} from './rules/VariablesAreInputTypes'; | ||
@@ -152,3 +148,3 @@ | ||
export { | ||
VariablesInAllowedPosition as VariablesInAllowedPositionRule | ||
VariablesInAllowedPosition as VariablesInAllowedPositionRule, | ||
} from './rules/VariablesInAllowedPosition'; |
import { GraphQLError } from '../error'; | ||
import { | ||
DocumentNode, | ||
OperationDefinitionNode, | ||
VariableNode, | ||
SelectionSetNode, | ||
FragmentSpreadNode, | ||
FragmentDefinitionNode, | ||
DocumentNode, | ||
OperationDefinitionNode, | ||
VariableNode, | ||
SelectionSetNode, | ||
FragmentSpreadNode, | ||
FragmentDefinitionNode, | ||
} from '../language/ast'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
import { | ||
GraphQLInputType, | ||
GraphQLOutputType, | ||
GraphQLCompositeType, | ||
GraphQLField, | ||
GraphQLArgument | ||
GraphQLInputType, | ||
GraphQLOutputType, | ||
GraphQLCompositeType, | ||
GraphQLField, | ||
GraphQLArgument, | ||
} from '../type/definition'; | ||
@@ -36,5 +36,5 @@ import { GraphQLDirective } from '../type/directives'; | ||
export function validate( | ||
schema: GraphQLSchema, | ||
ast: DocumentNode, | ||
rules?: any[] | ||
schema: GraphQLSchema, | ||
ast: DocumentNode, | ||
rules?: any[], | ||
): GraphQLError[]; | ||
@@ -49,12 +49,14 @@ | ||
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; | ||
} | ||
@@ -68,36 +70,36 @@ | ||
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
2945
95387