mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Merge pull request #15414 from firede/master
Updating GraphQL types to version 0.9.1
This commit is contained in:
+5
-5
@@ -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.
|
||||
|
||||
Vendored
+8
-2
@@ -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,
|
||||
|
||||
Vendored
+1
-1
@@ -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
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Vendored
+8
-3
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
@@ -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
@@ -7,5 +7,5 @@ import { DocumentNode, OperationDefinitionNode } from '../language/ast';
|
||||
*/
|
||||
export function getOperationAST(
|
||||
documentAST: DocumentNode,
|
||||
operationName: string
|
||||
operationName?: string
|
||||
): OperationDefinitionNode;
|
||||
|
||||
Vendored
+3
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user