@types/graphql
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -9,11 +9,11 @@ import { GraphQLError } from './GraphQLError'; | ||
export type GraphQLFormattedError = { | ||
message: string, | ||
locations?: Array<GraphQLErrorLocation>, | ||
path?: Array<string | number> | ||
}; | ||
export interface GraphQLFormattedError { | ||
message: string; | ||
locations?: GraphQLErrorLocation[]; | ||
path?: Array<string | number>; | ||
} | ||
export type GraphQLErrorLocation = { | ||
line: number, | ||
column: number | ||
}; | ||
export interface GraphQLErrorLocation { | ||
line: number; | ||
column: number; | ||
} |
@@ -12,3 +12,2 @@ import { getLocation } from '../language'; | ||
export class GraphQLError extends Error { | ||
/** | ||
@@ -44,3 +43,3 @@ * A message describing the Error for debugging purposes. | ||
*/ | ||
nodes?: Array<ASTNode> | undefined; | ||
nodes?: ASTNode[] | undefined; | ||
@@ -56,3 +55,3 @@ /** | ||
*/ | ||
positions?: Array<number> | undefined; | ||
positions?: number[] | undefined; | ||
@@ -66,5 +65,5 @@ /** | ||
message: string, | ||
nodes?: Array<any>, | ||
nodes?: any[], | ||
source?: Source, | ||
positions?: Array<number>, | ||
positions?: number[], | ||
path?: Array<string | number>, | ||
@@ -71,0 +70,0 @@ 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'; |
@@ -10,4 +10,4 @@ import { GraphQLError } from './GraphQLError'; | ||
originalError: Error, | ||
nodes: Array<T>, | ||
nodes: T[], | ||
path: Array<string | number> | ||
): GraphQLError; |
@@ -12,2 +12,2 @@ import { Source } from '../language/source'; | ||
description: string | ||
): GraphQLError; | ||
): GraphQLError; |
@@ -25,3 +25,3 @@ import { GraphQLError, locatedError } from '../error'; | ||
variableValues: { [key: string]: any }; | ||
errors: Array<GraphQLError>; | ||
errors: GraphQLError[]; | ||
} | ||
@@ -36,3 +36,3 @@ | ||
data?: { [key: string]: any }; | ||
errors?: Array<GraphQLError>; | ||
errors?: GraphQLError[]; | ||
} | ||
@@ -39,0 +39,0 @@ |
@@ -0,0 +0,0 @@ export { |
@@ -0,0 +0,0 @@ import { GraphQLSchema } from './type/schema'; |
// Type definitions for graphql 0.10 | ||
// Project: https://www.npmjs.com/package/graphql | ||
// Definitions by: TonyYang <https://github.com/TonyPythoneer>, Caleb Meredith <https://github.com/calebmer>, Dominic Watson <https://github.com/intellix>, Firede <https://github.com/firede>, Kepennar <https://github.com/kepennar> | ||
// Definitions by: TonyYang <https://github.com/TonyPythoneer> | ||
// Caleb Meredith <https://github.com/calebmer> | ||
// Dominic Watson <https://github.com/intellix> | ||
// Firede <https://github.com/firede> | ||
// Kepennar <https://github.com/kepennar> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -12,8 +16,5 @@ // TypeScript Version: 2.3 | ||
/// <reference types="graphql" /> | ||
// Create and operate on GraphQL type definitions and schema. | ||
export * from './type'; | ||
// Parse and operate on GraphQL language source files. | ||
@@ -32,3 +33,2 @@ export * from './language'; | ||
// Validate GraphQL queries. | ||
@@ -41,3 +41,2 @@ export { | ||
// Create and format GraphQL errors. | ||
@@ -51,3 +50,2 @@ export { | ||
// Utilities for operating on GraphQL type schema and parsed sources. | ||
@@ -54,0 +52,0 @@ export { |
@@ -7,4 +7,3 @@ import { Source } from './source'; | ||
*/ | ||
export type Location = { | ||
export interface Location { | ||
/** | ||
@@ -34,3 +33,3 @@ * The character offset at which this Node begins. | ||
source: Source; | ||
}; | ||
} | ||
@@ -41,27 +40,27 @@ /** | ||
*/ | ||
export type Token = { | ||
export interface Token { | ||
/** | ||
* The kind of Token. | ||
*/ | ||
kind: '<SOF>' | ||
| '<EOF>' | ||
| '!' | ||
| '$' | ||
| '(' | ||
| ')' | ||
| '...' | ||
| ':' | ||
| '=' | ||
| '@' | ||
| '[' | ||
| ']' | ||
| '{' | ||
| '|' | ||
| '}' | ||
| 'Name' | ||
| 'Int' | ||
| 'Float' | ||
| 'String' | ||
| 'Comment'; | ||
kind: | ||
| '<SOF>' | ||
| '<EOF>' | ||
| '!' | ||
| '$' | ||
| '(' | ||
| ')' | ||
| '...' | ||
| ':' | ||
| '=' | ||
| '@' | ||
| '[' | ||
| ']' | ||
| '{' | ||
| '|' | ||
| '}' | ||
| 'Name' | ||
| 'Int' | ||
| 'Float' | ||
| 'String' | ||
| 'Comment'; | ||
@@ -100,3 +99,3 @@ /** | ||
next?: Token; | ||
}; | ||
} | ||
@@ -106,3 +105,4 @@ /** | ||
*/ | ||
export type ASTNode = NameNode | ||
export type ASTNode = | ||
| NameNode | ||
| DocumentNode | ||
@@ -147,3 +147,3 @@ | OperationDefinitionNode | ||
export type NameNode = { | ||
export interface NameNode { | ||
kind: 'Name'; | ||
@@ -156,13 +156,14 @@ loc?: Location; | ||
export type DocumentNode = { | ||
export interface DocumentNode { | ||
kind: 'Document'; | ||
loc?: Location; | ||
definitions: Array<DefinitionNode>; | ||
definitions: DefinitionNode[]; | ||
} | ||
export type DefinitionNode = OperationDefinitionNode | ||
export type DefinitionNode = | ||
| OperationDefinitionNode | ||
| FragmentDefinitionNode | ||
| TypeSystemDefinitionNode // experimental non-spec addition. | ||
| TypeSystemDefinitionNode; // experimental non-spec addition. | ||
export type OperationDefinitionNode = { | ||
export interface OperationDefinitionNode { | ||
kind: 'OperationDefinition'; | ||
@@ -172,4 +173,4 @@ loc?: Location; | ||
name?: NameNode; | ||
variableDefinitions?: Array<VariableDefinitionNode>; | ||
directives?: Array<DirectiveNode>; | ||
variableDefinitions?: VariableDefinitionNode[]; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
@@ -181,3 +182,3 @@ } | ||
export type VariableDefinitionNode = { | ||
export interface VariableDefinitionNode { | ||
kind: 'VariableDefinition'; | ||
@@ -190,3 +191,3 @@ loc?: Location; | ||
export type VariableNode = { | ||
export interface VariableNode { | ||
kind: 'Variable'; | ||
@@ -197,13 +198,14 @@ loc?: Location; | ||
export type SelectionSetNode = { | ||
export interface SelectionSetNode { | ||
kind: 'SelectionSet'; | ||
loc?: Location; | ||
selections: Array<SelectionNode>; | ||
selections: SelectionNode[]; | ||
} | ||
export type SelectionNode = FieldNode | ||
export type SelectionNode = | ||
| FieldNode | ||
| FragmentSpreadNode | ||
| InlineFragmentNode | ||
| InlineFragmentNode; | ||
export type FieldNode = { | ||
export interface FieldNode { | ||
kind: 'Field'; | ||
@@ -213,8 +215,8 @@ loc?: Location; | ||
name: NameNode; | ||
arguments?: Array<ArgumentNode>; | ||
directives?: Array<DirectiveNode>; | ||
arguments?: ArgumentNode[]; | ||
directives?: DirectiveNode[]; | ||
selectionSet?: SelectionSetNode; | ||
} | ||
export type ArgumentNode = { | ||
export interface ArgumentNode { | ||
kind: 'Argument'; | ||
@@ -226,21 +228,20 @@ loc?: Location; | ||
// Fragments | ||
export type FragmentSpreadNode = { | ||
export interface FragmentSpreadNode { | ||
kind: 'FragmentSpread'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: Array<DirectiveNode>; | ||
directives?: DirectiveNode[]; | ||
} | ||
export type InlineFragmentNode = { | ||
export interface InlineFragmentNode { | ||
kind: 'InlineFragment'; | ||
loc?: Location; | ||
typeCondition?: NamedTypeNode; | ||
directives?: Array<DirectiveNode>; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
} | ||
export type FragmentDefinitionNode = { | ||
export interface FragmentDefinitionNode { | ||
kind: 'FragmentDefinition'; | ||
@@ -250,10 +251,10 @@ loc?: Location; | ||
typeCondition: NamedTypeNode; | ||
directives?: Array<DirectiveNode>; | ||
directives?: DirectiveNode[]; | ||
selectionSet: SelectionSetNode; | ||
} | ||
// Values | ||
export type ValueNode = VariableNode | ||
export type ValueNode = | ||
| VariableNode | ||
| IntValueNode | ||
@@ -266,5 +267,5 @@ | FloatValueNode | ||
| ListValueNode | ||
| ObjectValueNode | ||
| ObjectValueNode; | ||
export type IntValueNode = { | ||
export interface IntValueNode { | ||
kind: 'IntValue'; | ||
@@ -275,3 +276,3 @@ loc?: Location; | ||
export type FloatValueNode = { | ||
export interface FloatValueNode { | ||
kind: 'FloatValue'; | ||
@@ -282,3 +283,3 @@ loc?: Location; | ||
export type StringValueNode = { | ||
export interface StringValueNode { | ||
kind: 'StringValue'; | ||
@@ -289,3 +290,3 @@ loc?: Location; | ||
export type BooleanValueNode = { | ||
export interface BooleanValueNode { | ||
kind: 'BooleanValue'; | ||
@@ -296,3 +297,3 @@ loc?: Location; | ||
export type NullValueNode = { | ||
export interface NullValueNode { | ||
kind: 'NullValue'; | ||
@@ -302,3 +303,3 @@ loc?: Location; | ||
export type EnumValueNode = { | ||
export interface EnumValueNode { | ||
kind: 'EnumValue'; | ||
@@ -309,15 +310,15 @@ loc?: Location; | ||
export type ListValueNode = { | ||
export interface ListValueNode { | ||
kind: 'ListValue'; | ||
loc?: Location; | ||
values: Array<ValueNode>; | ||
values: ValueNode[]; | ||
} | ||
export type ObjectValueNode = { | ||
export interface ObjectValueNode { | ||
kind: 'ObjectValue'; | ||
loc?: Location; | ||
fields: Array<ObjectFieldNode>; | ||
fields: ObjectFieldNode[]; | ||
} | ||
export type ObjectFieldNode = { | ||
export interface ObjectFieldNode { | ||
kind: 'ObjectField'; | ||
@@ -329,26 +330,25 @@ loc?: Location; | ||
// Directives | ||
export type DirectiveNode = { | ||
export interface DirectiveNode { | ||
kind: 'Directive'; | ||
loc?: Location; | ||
name: NameNode; | ||
arguments?: Array<ArgumentNode>; | ||
arguments?: ArgumentNode[]; | ||
} | ||
// Type Reference | ||
export type TypeNode = NamedTypeNode | ||
export type TypeNode = | ||
| NamedTypeNode | ||
| ListTypeNode | ||
| NonNullTypeNode | ||
| NonNullTypeNode; | ||
export type NamedTypeNode = { | ||
export interface NamedTypeNode { | ||
kind: 'NamedType'; | ||
loc?: Location; | ||
name: NameNode; | ||
}; | ||
} | ||
export type ListTypeNode = { | ||
export interface ListTypeNode { | ||
kind: 'ListType'; | ||
@@ -359,3 +359,3 @@ loc?: Location; | ||
export type NonNullTypeNode = { | ||
export interface NonNullTypeNode { | ||
kind: 'NonNullType'; | ||
@@ -368,15 +368,16 @@ loc?: Location; | ||
export type TypeSystemDefinitionNode = SchemaDefinitionNode | ||
export type TypeSystemDefinitionNode = | ||
| SchemaDefinitionNode | ||
| TypeDefinitionNode | ||
| TypeExtensionDefinitionNode | ||
| DirectiveDefinitionNode | ||
| DirectiveDefinitionNode; | ||
export type SchemaDefinitionNode = { | ||
export interface SchemaDefinitionNode { | ||
kind: 'SchemaDefinition'; | ||
loc?: Location; | ||
directives: Array<DirectiveNode>; | ||
operationTypes: Array<OperationTypeDefinitionNode>; | ||
directives: DirectiveNode[]; | ||
operationTypes: OperationTypeDefinitionNode[]; | ||
} | ||
export type OperationTypeDefinitionNode = { | ||
export interface OperationTypeDefinitionNode { | ||
kind: 'OperationTypeDefinition'; | ||
@@ -388,3 +389,4 @@ loc?: Location; | ||
export type TypeDefinitionNode = ScalarTypeDefinitionNode | ||
export type TypeDefinitionNode = | ||
| ScalarTypeDefinitionNode | ||
| ObjectTypeDefinitionNode | ||
@@ -394,30 +396,30 @@ | InterfaceTypeDefinitionNode | ||
| EnumTypeDefinitionNode | ||
| InputObjectTypeDefinitionNode | ||
| InputObjectTypeDefinitionNode; | ||
export type ScalarTypeDefinitionNode = { | ||
export interface ScalarTypeDefinitionNode { | ||
kind: 'ScalarTypeDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: Array<DirectiveNode>; | ||
directives?: DirectiveNode[]; | ||
} | ||
export type ObjectTypeDefinitionNode = { | ||
export interface ObjectTypeDefinitionNode { | ||
kind: 'ObjectTypeDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
interfaces?: Array<NamedTypeNode>; | ||
directives?: Array<DirectiveNode>; | ||
fields: Array<FieldDefinitionNode>; | ||
interfaces?: NamedTypeNode[]; | ||
directives?: DirectiveNode[]; | ||
fields: FieldDefinitionNode[]; | ||
} | ||
export type FieldDefinitionNode = { | ||
export interface FieldDefinitionNode { | ||
kind: 'FieldDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
arguments: Array<InputValueDefinitionNode>; | ||
arguments: InputValueDefinitionNode[]; | ||
type: TypeNode; | ||
directives?: Array<DirectiveNode>; | ||
directives?: DirectiveNode[]; | ||
} | ||
export type InputValueDefinitionNode = { | ||
export interface InputValueDefinitionNode { | ||
kind: 'InputValueDefinition'; | ||
@@ -428,45 +430,45 @@ loc?: Location; | ||
defaultValue?: ValueNode; | ||
directives?: Array<DirectiveNode>; | ||
directives?: DirectiveNode[]; | ||
} | ||
export type InterfaceTypeDefinitionNode = { | ||
export interface InterfaceTypeDefinitionNode { | ||
kind: 'InterfaceTypeDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: Array<DirectiveNode>; | ||
fields: Array<FieldDefinitionNode>; | ||
directives?: DirectiveNode[]; | ||
fields: FieldDefinitionNode[]; | ||
} | ||
export type UnionTypeDefinitionNode = { | ||
export interface UnionTypeDefinitionNode { | ||
kind: 'UnionTypeDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: Array<DirectiveNode>; | ||
types: Array<NamedTypeNode>; | ||
directives?: DirectiveNode[]; | ||
types: NamedTypeNode[]; | ||
} | ||
export type EnumTypeDefinitionNode = { | ||
export interface EnumTypeDefinitionNode { | ||
kind: 'EnumTypeDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: Array<DirectiveNode>; | ||
values: Array<EnumValueDefinitionNode>; | ||
directives?: DirectiveNode[]; | ||
values: EnumValueDefinitionNode[]; | ||
} | ||
export type EnumValueDefinitionNode = { | ||
export interface EnumValueDefinitionNode { | ||
kind: 'EnumValueDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: Array<DirectiveNode>; | ||
directives?: DirectiveNode[]; | ||
} | ||
export type InputObjectTypeDefinitionNode = { | ||
export interface InputObjectTypeDefinitionNode { | ||
kind: 'InputObjectTypeDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
directives?: Array<DirectiveNode>; | ||
fields: Array<InputValueDefinitionNode>; | ||
directives?: DirectiveNode[]; | ||
fields: InputValueDefinitionNode[]; | ||
} | ||
export type TypeExtensionDefinitionNode = { | ||
export interface TypeExtensionDefinitionNode { | ||
kind: 'TypeExtensionDefinition'; | ||
@@ -477,8 +479,8 @@ loc?: Location; | ||
export type DirectiveDefinitionNode = { | ||
export interface DirectiveDefinitionNode { | ||
kind: 'DirectiveDefinition'; | ||
loc?: Location; | ||
name: NameNode; | ||
arguments?: Array<InputValueDefinitionNode>; | ||
locations: Array<NameNode>; | ||
arguments?: InputValueDefinitionNode[]; | ||
locations: NameNode[]; | ||
} |
@@ -0,0 +0,0 @@ export * from './ast'; |
@@ -66,2 +66,2 @@ // Name | ||
export const DIRECTIVE_DEFINITION: 'DirectiveDefinition'; | ||
export const DIRECTIVE_DEFINITION: 'DirectiveDefinition'; |
@@ -21,3 +21,3 @@ import { Token } from './ast'; | ||
*/ | ||
export type Lexer<TOptions> = { | ||
export interface Lexer<TOptions> { | ||
source: Source; | ||
@@ -50,3 +50,3 @@ options: TOptions; | ||
advance(): Token; | ||
}; | ||
} | ||
@@ -53,0 +53,0 @@ /** |
import { Source } from "./source"; | ||
export interface SourceLocation { | ||
@@ -5,0 +4,0 @@ line: number; |
@@ -8,3 +8,3 @@ import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from "./ast"; | ||
*/ | ||
export type ParseOptions = { | ||
export interface ParseOptions { | ||
/** | ||
@@ -15,4 +15,4 @@ * By default, the parser creates AST nodes that know the location | ||
*/ | ||
noLocation?: boolean | ||
}; | ||
noLocation?: boolean; | ||
} | ||
@@ -19,0 +19,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ export class Source { |
@@ -41,3 +41,3 @@ export const QueryDocumentKeys: { | ||
TypeExtensionDefinition: string[]; | ||
} | ||
}; | ||
@@ -44,0 +44,0 @@ export const BREAK: any; |
{ | ||
"name": "@types/graphql", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "TypeScript definitions for graphql", | ||
@@ -36,4 +36,4 @@ "license": "MIT", | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "858c35f07418b977ac6268c171fb1c7574ef2364b62e51b03db9774bb576357f", | ||
"typesPublisherContentHash": "a743775e6abf56eee739dba05a9a547b83e2ea3796d016e976f49c36f256533a", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 14 Jul 2017 14:13:25 GMT | ||
* Last updated: Mon, 24 Jul 2017 18:01:45 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
export { subscribe, createSourceEventStream } from './subscribe'; |
@@ -0,0 +0,0 @@ import { GraphQLSchema } from '../type/schema'; |
@@ -13,10 +13,10 @@ import { | ||
export type GraphQLType = | ||
GraphQLScalarType | | ||
GraphQLObjectType | | ||
GraphQLInterfaceType | | ||
GraphQLUnionType | | ||
GraphQLEnumType | | ||
GraphQLInputObjectType | | ||
GraphQLList<any> | | ||
GraphQLNonNull<any>; | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType | ||
| GraphQLList<any> | ||
| GraphQLNonNull<any>; | ||
@@ -31,12 +31,11 @@ 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>>; | ||
@@ -51,16 +50,15 @@ 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>>; | ||
@@ -75,4 +73,4 @@ export function isOutputType(type: GraphQLType): type is GraphQLOutputType; | ||
export type GraphQLLeafType = | ||
GraphQLScalarType | | ||
GraphQLEnumType; | ||
| GraphQLScalarType | ||
| GraphQLEnumType; | ||
@@ -87,5 +85,5 @@ export function isLeafType(type: GraphQLType): type is GraphQLLeafType; | ||
export type GraphQLCompositeType = | ||
GraphQLObjectType | | ||
GraphQLInterfaceType | | ||
GraphQLUnionType; | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType; | ||
@@ -100,4 +98,4 @@ export function isCompositeType(type: GraphQLType): type is GraphQLCompositeType; | ||
export type GraphQLAbstractType = | ||
GraphQLInterfaceType | | ||
GraphQLUnionType; | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType; | ||
@@ -112,9 +110,9 @@ 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>; | ||
@@ -129,8 +127,8 @@ export function getNullableType<T extends GraphQLType>( | ||
export type GraphQLNamedType = | ||
GraphQLScalarType | | ||
GraphQLObjectType | | ||
GraphQLInterfaceType | | ||
GraphQLUnionType | | ||
GraphQLEnumType | | ||
GraphQLInputObjectType; | ||
| GraphQLScalarType | ||
| GraphQLObjectType | ||
| GraphQLInterfaceType | ||
| GraphQLUnionType | ||
| GraphQLEnumType | ||
| GraphQLInputObjectType; | ||
@@ -186,5 +184,5 @@ export function isNamedType(type: GraphQLType): boolean; | ||
description?: string; | ||
serialize: (value: any) => TExternal | null | undefined; | ||
parseValue?: (value: any) => TInternal | null | undefined; | ||
parseLiteral?: (valueNode: ValueNode) => TInternal | null | undefined; | ||
serialize(value: any): TExternal | null | undefined; | ||
parseValue?(value: any): TInternal | null | undefined; | ||
parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; | ||
} | ||
@@ -236,13 +234,12 @@ | ||
getFields(): GraphQLFieldMap<any, any>; | ||
getInterfaces(): Array<GraphQLInterfaceType>; | ||
getInterfaces(): GraphQLInterfaceType[]; | ||
toString(): string; | ||
} | ||
export interface GraphQLObjectTypeConfig<TSource, TContext> { | ||
name: string; | ||
interfaces?: Thunk<Array<GraphQLInterfaceType>>; | ||
interfaces?: Thunk<GraphQLInterfaceType[]>; | ||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>; | ||
isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext>; | ||
description?: string | ||
description?: string; | ||
} | ||
@@ -271,3 +268,3 @@ | ||
fieldName: string; | ||
fieldNodes: Array<FieldNode>; | ||
fieldNodes: FieldNode[]; | ||
returnType: GraphQLOutputType; | ||
@@ -311,3 +308,3 @@ parentType: GraphQLCompositeType; | ||
type: GraphQLOutputType; | ||
args: Array<GraphQLArgument>; | ||
args: GraphQLArgument[]; | ||
resolve?: GraphQLFieldResolver<TSource, TContext>; | ||
@@ -360,4 +357,4 @@ isDeprecated?: boolean; | ||
export interface GraphQLInterfaceTypeConfig<TSource, TContext> { | ||
name: string, | ||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>, | ||
name: string; | ||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>; | ||
/** | ||
@@ -368,4 +365,4 @@ * Optionally provide a custom type resolver function. If one is not provided, | ||
*/ | ||
resolveType?: GraphQLTypeResolver<TSource, TContext>, | ||
description?: string | ||
resolveType?: GraphQLTypeResolver<TSource, TContext>; | ||
description?: string; | ||
} | ||
@@ -403,3 +400,3 @@ | ||
getTypes(): Array<GraphQLObjectType>; | ||
getTypes(): GraphQLObjectType[]; | ||
@@ -410,4 +407,4 @@ toString(): string; | ||
export interface GraphQLUnionTypeConfig<TSource, TContext> { | ||
name: string, | ||
types: Thunk<Array<GraphQLObjectType>>, | ||
name: string; | ||
types: Thunk<GraphQLObjectType[]>; | ||
/** | ||
@@ -448,3 +445,3 @@ * Optionally provide a custom type resolver function. If one is not provided, | ||
constructor(config: GraphQLEnumTypeConfig); | ||
getValues(): Array<GraphQLEnumValue>; | ||
getValues(): GraphQLEnumValue[]; | ||
getValue(name: string): GraphQLEnumValue; | ||
@@ -451,0 +448,0 @@ serialize(value: any): string; |
@@ -6,3 +6,2 @@ import { | ||
export const DirectiveLocation: { | ||
@@ -31,3 +30,3 @@ // Operations | ||
export type DirectiveLocationEnum = any //$Keys<typeof DirectiveLocation> | ||
export type DirectiveLocationEnum = keyof typeof DirectiveLocation; | ||
@@ -41,4 +40,4 @@ /** | ||
description: string; | ||
locations: Array<DirectiveLocationEnum>; | ||
args: Array<GraphQLArgument>; | ||
locations: DirectiveLocationEnum[]; | ||
args: GraphQLArgument[]; | ||
@@ -51,3 +50,3 @@ constructor(config: GraphQLDirectiveConfig); | ||
description?: string; | ||
locations: Array<DirectiveLocationEnum>; | ||
locations: DirectiveLocationEnum[]; | ||
args?: GraphQLFieldConfigArgumentMap; | ||
@@ -79,2 +78,2 @@ } | ||
*/ | ||
export const specifiedDirectives: Array<GraphQLDirective>; | ||
export const specifiedDirectives: GraphQLDirective[]; |
@@ -0,0 +0,0 @@ // GraphQL Schema definition |
@@ -13,3 +13,2 @@ import { | ||
export const __Schema: GraphQLObjectType; | ||
@@ -32,3 +31,3 @@ export const __Directive: GraphQLObjectType; | ||
NON_NULL: 'NON_NULL', | ||
} | ||
}; | ||
@@ -35,0 +34,0 @@ export const __TypeKind: GraphQLEnumType; |
import { GraphQLScalarType } from './definition'; | ||
export const GraphQLInt: GraphQLScalarType; | ||
@@ -5,0 +4,0 @@ export const GraphQLFloat: GraphQLScalarType; |
@@ -13,3 +13,2 @@ import { | ||
/** | ||
@@ -57,3 +56,3 @@ * Schema Definition | ||
getType(name: string): GraphQLType; | ||
getPossibleTypes(abstractType: GraphQLAbstractType): Array<GraphQLObjectType>; | ||
getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; | ||
@@ -65,3 +64,3 @@ isPossibleType( | ||
getDirectives(): Array<GraphQLDirective>; | ||
getDirectives(): GraphQLDirective[]; | ||
getDirective(name: string): GraphQLDirective; | ||
@@ -74,4 +73,4 @@ } | ||
subscription?: GraphQLObjectType; | ||
types?: Array<GraphQLNamedType>; | ||
directives?: Array<GraphQLDirective>; | ||
types?: GraphQLNamedType[]; | ||
directives?: GraphQLDirective[]; | ||
} |
// Helper to assert that provided names are valid. | ||
export function assertValidName(name: string): void; | ||
export function assertValidName(name: string): void; |
import { | ||
ValueNode, | ||
//IntValueNode, | ||
//FloatValueNode, | ||
//StringValueNode, | ||
//BooleanValueNode, | ||
//EnumValueNode, | ||
//ListValueNode, | ||
//ObjectValueNode, | ||
/* | ||
TODO: | ||
IntValueNode, | ||
FloatValueNode, | ||
StringValueNode, | ||
BooleanValueNode, | ||
EnumValueNode, | ||
ListValueNode, | ||
ObjectValueNode, | ||
*/ | ||
} from '../language/ast'; | ||
@@ -33,2 +36,2 @@ import { GraphQLInputType } from '../type/definition'; | ||
type: GraphQLInputType | ||
): ValueNode // Warning: there is a code in bottom: throw new TypeError | ||
): ValueNode; // Warning: there is a code in bottom: throw new TypeError |
@@ -5,3 +5,2 @@ import { DocumentNode, Location } from '../language/ast'; | ||
/** | ||
@@ -28,3 +27,3 @@ * This takes the ast of a schema document produced by the parse function in | ||
* document. | ||
*/ | ||
*/ | ||
export function buildSchema(source: string | Source): GraphQLSchema; |
import { IntrospectionQuery } from './introspectionQuery'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
/** | ||
@@ -6,0 +5,0 @@ * Build a GraphQLSchema for use by client tools. |
import { DocumentNode } from '../language/ast'; | ||
/** | ||
@@ -9,2 +8,2 @@ * Provided a collection of ASTs, presumably each from different files, | ||
*/ | ||
export function concatAST(asts: Array<DocumentNode>): DocumentNode; | ||
export function concatAST(asts: DocumentNode[]): DocumentNode; |
import { DocumentNode } from '../language/ast'; | ||
import { GraphQLSchema } from '../type/schema'; | ||
/** | ||
@@ -6,0 +5,0 @@ * Produces a new schema given an existing schema and a document which may |
@@ -13,3 +13,2 @@ import { | ||
export const BreakingChangeType: { | ||
@@ -24,3 +23,4 @@ FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', | ||
export type BreakingChangeKey = 'FIELD_CHANGED_KIND' | ||
export type BreakingChangeKey = | ||
| 'FIELD_CHANGED_KIND' | ||
| 'FIELD_REMOVED' | ||
@@ -32,6 +32,6 @@ | 'TYPE_CHANGED_KIND' | ||
export type BreakingChange = { | ||
export interface BreakingChange { | ||
type: BreakingChangeKey; | ||
description: string; | ||
}; | ||
} | ||
@@ -45,3 +45,3 @@ /** | ||
newSchema: GraphQLSchema | ||
): Array<BreakingChange> | ||
): BreakingChange[]; | ||
@@ -55,3 +55,3 @@ /** | ||
newSchema: GraphQLSchema | ||
): Array<BreakingChange> | ||
): BreakingChange[]; | ||
@@ -65,3 +65,3 @@ /** | ||
newSchema: GraphQLSchema | ||
): Array<BreakingChange> | ||
): BreakingChange[]; | ||
@@ -76,3 +76,3 @@ /** | ||
newSchema: GraphQLSchema | ||
): Array<BreakingChange>; | ||
): BreakingChange[]; | ||
@@ -86,3 +86,3 @@ /** | ||
newSchema: GraphQLSchema | ||
): Array<BreakingChange>; | ||
): BreakingChange[]; | ||
@@ -96,2 +96,2 @@ /** | ||
newSchema: GraphQLSchema | ||
): Array<BreakingChange>; | ||
): BreakingChange[]; |
@@ -13,2 +13,2 @@ import { GraphQLSchema } from '../type/schema'; | ||
ast: DocumentNode | ||
): Array<GraphQLError> | ||
): GraphQLError[]; |
@@ -0,0 +0,0 @@ import { DocumentNode, OperationDefinitionNode } from '../language/ast'; |
@@ -0,0 +0,0 @@ // The GraphQL query recommended for a full schema introspection. |
@@ -98,5 +98,4 @@ import { DirectiveLocationEnum } from '../type/directives'; | ||
export interface IntrospectionQuery { | ||
__schema: IntrospectionSchema | ||
__schema: IntrospectionSchema; | ||
} | ||
@@ -108,13 +107,13 @@ | ||
subscriptionType?: IntrospectionNamedTypeRef; | ||
types: Array<IntrospectionType>; | ||
directives: Array<IntrospectionDirective>; | ||
types: IntrospectionType[]; | ||
directives: IntrospectionDirective[]; | ||
} | ||
export type IntrospectionType = | ||
IntrospectionScalarType | | ||
IntrospectionObjectType | | ||
IntrospectionInterfaceType | | ||
IntrospectionUnionType | | ||
IntrospectionEnumType | | ||
IntrospectionInputObjectType; | ||
| IntrospectionScalarType | ||
| IntrospectionObjectType | ||
| IntrospectionInterfaceType | ||
| IntrospectionUnionType | ||
| IntrospectionEnumType | ||
| IntrospectionInputObjectType; | ||
@@ -131,4 +130,4 @@ export interface IntrospectionScalarType { | ||
description?: string; | ||
fields: Array<IntrospectionField>; | ||
interfaces: Array<IntrospectionNamedTypeRef>; | ||
fields: IntrospectionField[]; | ||
interfaces: IntrospectionNamedTypeRef[]; | ||
} | ||
@@ -140,4 +139,4 @@ | ||
description?: string; | ||
fields: Array<IntrospectionField>; | ||
possibleTypes: Array<IntrospectionNamedTypeRef>; | ||
fields: IntrospectionField[]; | ||
possibleTypes: IntrospectionNamedTypeRef[]; | ||
} | ||
@@ -149,3 +148,3 @@ | ||
description?: string; | ||
possibleTypes: Array<IntrospectionNamedTypeRef>; | ||
possibleTypes: IntrospectionNamedTypeRef[]; | ||
} | ||
@@ -157,3 +156,3 @@ | ||
description?: string; | ||
enumValues: Array<IntrospectionEnumValue>; | ||
enumValues: IntrospectionEnumValue[]; | ||
} | ||
@@ -165,9 +164,9 @@ | ||
description?: string; | ||
inputFields: Array<IntrospectionInputValue>; | ||
inputFields: IntrospectionInputValue[]; | ||
} | ||
export type IntrospectionTypeRef = | ||
IntrospectionNamedTypeRef | | ||
IntrospectionListTypeRef | | ||
IntrospectionNonNullTypeRef | ||
| IntrospectionNamedTypeRef | ||
| IntrospectionListTypeRef | ||
| IntrospectionNonNullTypeRef; | ||
@@ -192,3 +191,3 @@ export interface IntrospectionNamedTypeRef { | ||
description?: string; | ||
args: Array<IntrospectionInputValue>; | ||
args: IntrospectionInputValue[]; | ||
type: IntrospectionTypeRef; | ||
@@ -216,4 +215,4 @@ isDeprecated: boolean; | ||
description?: string; | ||
locations: Array<DirectiveLocationEnum>; | ||
args: Array<IntrospectionInputValue>; | ||
locations: DirectiveLocationEnum[]; | ||
args: IntrospectionInputValue[]; | ||
} |
@@ -11,2 +11,2 @@ import { GraphQLInputType } from '../type/definition'; | ||
type: GraphQLInputType | ||
): Array<string> | ||
): string[]; |
@@ -14,2 +14,2 @@ import { ValueNode } from '../language/ast'; | ||
valueNode: ValueNode | ||
): Array<string> | ||
): string[]; |
@@ -0,0 +0,0 @@ import { GraphQLSchema } from '../type/schema'; |
@@ -8,2 +8,2 @@ import { | ||
documentAST: DocumentNode | ||
): { [operationName: string]: DocumentNode } | ||
): { [operationName: string]: DocumentNode }; |
@@ -10,3 +10,2 @@ import { | ||
/** | ||
@@ -13,0 +12,0 @@ * Provided two types, return true if the types are equal (invariant). |
@@ -8,2 +8,2 @@ import { TypeNode } from '../language/ast'; | ||
typeNode: TypeNode | ||
): GraphQLType | ||
): GraphQLType; |
@@ -39,8 +39,6 @@ import { GraphQLSchema } from '../type/schema'; | ||
export interface getFieldDef { | ||
( | ||
schema: GraphQLSchema, | ||
parentType: GraphQLType, | ||
fieldNode: FieldNode | ||
): GraphQLField<any, any> | ||
} | ||
export type getFieldDef = ( | ||
schema: GraphQLSchema, | ||
parentType: GraphQLType, | ||
fieldNode: FieldNode, | ||
) => GraphQLField<any, any>; |
@@ -9,3 +9,2 @@ import { GraphQLInputType } from '../type/definition'; | ||
export function valueFromAST( | ||
@@ -12,0 +11,0 @@ valueNode: ValueNode, |
export { validate, ValidationContext } from './validate'; | ||
export { specifiedRules } from './specifiedRules'; |
@@ -0,0 +0,0 @@ import { ValidationContext } from './validate'; // It needs to check. |
@@ -22,5 +22,2 @@ import { GraphQLError } from '../error'; | ||
//type ValidationRule = (context: ValidationContext) => any; | ||
/** | ||
@@ -42,4 +39,4 @@ * Implements the "Validation" section of the spec. | ||
ast: DocumentNode, | ||
rules?: Array<any> | ||
): Array<GraphQLError>; | ||
rules?: any[] | ||
): GraphQLError[]; | ||
@@ -56,9 +53,9 @@ /** | ||
documentAST: DocumentNode, | ||
rules: Array<any> | ||
): Array<GraphQLError>; | ||
rules: any[] | ||
): GraphQLError[]; | ||
export type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; | ||
export interface VariableUsage { | ||
node: VariableNode, | ||
type: GraphQLInputType | ||
node: VariableNode; | ||
type: GraphQLInputType; | ||
} | ||
@@ -75,3 +72,3 @@ | ||
getErrors(): Array<GraphQLError>; | ||
getErrors(): GraphQLError[]; | ||
@@ -84,13 +81,13 @@ getSchema(): GraphQLSchema; | ||
getFragmentSpreads(node: SelectionSetNode): Array<FragmentSpreadNode>; | ||
getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; | ||
getRecursivelyReferencedFragments( | ||
operation: OperationDefinitionNode | ||
): Array<FragmentDefinitionNode>; | ||
): FragmentDefinitionNode[]; | ||
getVariableUsages(node: NodeWithSelectionSet): Array<VariableUsage>; | ||
getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; | ||
getRecursiveVariableUsages( | ||
operation: OperationDefinitionNode | ||
): Array<VariableUsage>; | ||
): VariableUsage[]; | ||
@@ -108,2 +105,2 @@ getType(): GraphQLOutputType; | ||
getArgument(): GraphQLArgument; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
2350
74634