Merge pull request #15414 from firede/master

Updating GraphQL types to version 0.9.1
This commit is contained in:
Nathan Shively-Sanders
2017-03-27 10:33:58 -07:00
committed by GitHub
10 changed files with 43 additions and 26 deletions
+5 -5
View File
@@ -27,7 +27,7 @@ export class GraphQLError extends Error {
*
* Enumerable, and appears in the result of JSON.stringify().
*/
locations?: Array<{ line: number, column: number }> | void;
locations?: Array<{ line: number, column: number }> | undefined;
/**
* An array describing the JSON-path into the execution response which
@@ -35,23 +35,23 @@ export class GraphQLError extends Error {
*
* Enumerable, and appears in the result of JSON.stringify().
*/
path?: Array<string | number> | void;
path?: Array<string | number> | undefined;
/**
* An array of GraphQL AST Nodes corresponding to this error.
*/
nodes?: Array<ASTNode> | void;
nodes?: Array<ASTNode> | undefined;
/**
* The source GraphQL document corresponding to this error.
*/
source?: Source | void;
source?: Source | undefined;
/**
* An array of character offsets within the source GraphQL document
* which correspond to this error.
*/
positions?: Array<number> | void;
positions?: Array<number> | undefined;
/**
* The original error thrown from a field resolver during execution.
+8 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for graphql v0.8.2
// Type definitions for graphql 0.9
// 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>
// Definitions by: TonyYang <https://github.com/TonyPythoneer>, Caleb Meredith <https://github.com/calebmer>, Dominic Watson <https://github.com/intellix>, Firede <https://github.com/firede>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -105,6 +105,12 @@ export {
// Asserts a string is a valid GraphQL name.
assertValidName,
// Compares two GraphQLSchemas and detects breaking changes.
findBreakingChanges,
// Report all deprecated usage within a GraphQL document.
findDeprecatedUsages,
BreakingChange,
IntrospectionDirective,
+1 -1
View File
@@ -85,7 +85,7 @@ export type Token = {
/**
* For non-punctuation tokens, represents the interpreted value of the token.
*/
value: string | void;
value: string | undefined;
/**
* Tokens exist as nodes in a double-linked-list amongst all tokens
+1 -1
View File
@@ -42,7 +42,7 @@ export const QueryDocumentKeys: {
export const BREAK: any;
export function visit(root: any, visitor: any, keyMap: any): any;
export function visit(root: any, visitor: any, keyMap?: any): any;
export function visitInParallel(visitors: any): any;
+8 -3
View File
@@ -126,6 +126,10 @@ export type GraphQLNamedType =
GraphQLEnumType |
GraphQLInputObjectType;
export function isNamedType(type: GraphQLType): boolean;
export function assertNamedType(type: GraphQLType): GraphQLNamedType;
export function getNamedType(type: GraphQLType): GraphQLNamedType;
/**
@@ -237,13 +241,13 @@ export type GraphQLTypeResolver<TSource, TContext> = (
value: TSource,
context: TContext,
info: GraphQLResolveInfo
) => GraphQLObjectType;
) => GraphQLObjectType | string | Promise<GraphQLObjectType | string>;
export type GraphQLIsTypeOfFn<TSource, TContext> = (
source: TSource,
context: TContext,
info: GraphQLResolveInfo
) => boolean;
) => boolean | Promise<boolean>;
export type GraphQLFieldResolver<TSource, TContext> = (
source: TSource,
@@ -265,7 +269,7 @@ export interface GraphQLResolveInfo {
variableValues: { [variableName: string]: any };
}
export type ResponsePath = { prev: ResponsePath, key: string | number } | void;
export type ResponsePath = { prev: ResponsePath, key: string | number } | undefined;
export interface GraphQLFieldConfig<TSource, TContext> {
type: GraphQLOutputType;
@@ -426,6 +430,7 @@ export class GraphQLEnumType {
constructor(config: GraphQLEnumTypeConfig);
getValues(): Array<GraphQLEnumValue>;
getValue(name: string): GraphQLEnumValue;
serialize(value: any): string;
parseValue(value: any): any;
parseLiteral(valueNode: ValueNode): any;
+3 -1
View File
@@ -5,6 +5,7 @@ import {
GraphQLInputType,
GraphQLField,
GraphQLArgument,
GraphQLEnumValue,
GraphQLType,
} from '../type/definition';
import { GraphQLDirective } from '../type/directives';
@@ -30,6 +31,7 @@ export class TypeInfo {
getFieldDef(): GraphQLField<any, any>;
getDirective(): GraphQLDirective;
getArgument(): GraphQLArgument;
getEnumValue(): GraphQLEnumValue;
enter(node: ASTNode): any;
leave(node: ASTNode): any;
}
@@ -40,4 +42,4 @@ export interface getFieldDef {
parentType: GraphQLType,
fieldNode: FieldNode
): GraphQLField<any, any>
}
}
-12
View File
@@ -26,15 +26,3 @@ export function getDescription(node: { loc?: Location }): string;
* document.
*/
export function buildSchema(source: string | Source): GraphQLSchema;
/**
* Given an ast node, returns its string description based on a contiguous
* block full-line of comments preceding it.
*/
export function getDescription(node: { loc?: Location }): string;
/**
* A helper function to build a GraphQLSchema directly from a source
* document.
*/
export function buildSchema(source: string | Source): GraphQLSchema;
+13
View File
@@ -0,0 +1,13 @@
import { GraphQLSchema } from '../type/schema';
import { DocumentNode } from '../language/ast';
import { GraphQLError } from '../error/GraphQLError';
/**
* A validation rule which reports deprecated usages.
*
* Returns a list of GraphQLError instances describing each deprecated use.
*/
export function findDeprecatedUsages(
schema: GraphQLSchema,
ast: DocumentNode
): Array<GraphQLError>
+1 -1
View File
@@ -7,5 +7,5 @@ import { DocumentNode, OperationDefinitionNode } from '../language/ast';
*/
export function getOperationAST(
documentAST: DocumentNode,
operationName: string
operationName?: string
): OperationDefinitionNode;
+3
View File
@@ -73,3 +73,6 @@ export { assertValidName } from './assertValidName';
// Compares two GraphQLSchemas and detects breaking changes.
export { findBreakingChanges } from './findBreakingChanges';
export { BreakingChange } from './findBreakingChanges';
// Report all deprecated usage within a GraphQL document.
export { findDeprecatedUsages } from './findDeprecatedUsages';