mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Add astNode properties to GraphQL types
This commit is contained in:
Vendored
+32
@@ -1,4 +1,14 @@
|
||||
import {
|
||||
ScalarTypeDefinitionNode,
|
||||
ObjectTypeDefinitionNode,
|
||||
FieldDefinitionNode,
|
||||
InputValueDefinitionNode,
|
||||
InterfaceTypeDefinitionNode,
|
||||
UnionTypeDefinitionNode,
|
||||
EnumTypeDefinitionNode,
|
||||
EnumValueDefinitionNode,
|
||||
InputObjectTypeDefinitionNode,
|
||||
TypeExtensionDefinitionNode,
|
||||
OperationDefinitionNode,
|
||||
FieldNode,
|
||||
FragmentDefinitionNode,
|
||||
@@ -156,6 +166,7 @@ export type Thunk<T> = (() => T) | T;
|
||||
export class GraphQLScalarType {
|
||||
name: string;
|
||||
description: string;
|
||||
astNode?: ScalarTypeDefinitionNode;
|
||||
constructor(config: GraphQLScalarTypeConfig<any, any>);
|
||||
|
||||
// Serializes an internal value to include in a response.
|
||||
@@ -173,6 +184,7 @@ export class GraphQLScalarType {
|
||||
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;
|
||||
@@ -218,6 +230,8 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
|
||||
export class GraphQLObjectType {
|
||||
name: string;
|
||||
description: string;
|
||||
astNode?: ObjectTypeDefinitionNode;
|
||||
extensionASTNodes: Array<TypeExtensionDefinitionNode>;
|
||||
isTypeOf: GraphQLIsTypeOfFn<any, any>;
|
||||
|
||||
constructor(config: GraphQLObjectTypeConfig<any, any>);
|
||||
@@ -232,6 +246,8 @@ export interface GraphQLObjectTypeConfig<TSource, TContext> {
|
||||
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>;
|
||||
isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext>;
|
||||
description?: string;
|
||||
astNode?: ObjectTypeDefinitionNode;
|
||||
extensionASTNodes?: Array<TypeExtensionDefinitionNode>;
|
||||
}
|
||||
|
||||
export type GraphQLTypeResolver<TSource, TContext> = (
|
||||
@@ -274,6 +290,7 @@ export interface GraphQLFieldConfig<TSource, TContext> {
|
||||
resolve?: GraphQLFieldResolver<TSource, TContext>;
|
||||
deprecationReason?: string;
|
||||
description?: string;
|
||||
astNode?: FieldDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLFieldConfigArgumentMap {
|
||||
@@ -284,6 +301,7 @@ export interface GraphQLArgumentConfig {
|
||||
type: GraphQLInputType;
|
||||
defaultValue?: any;
|
||||
description?: string;
|
||||
astNode?: InputValueDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLFieldConfigMap<TSource, TContext> {
|
||||
@@ -298,6 +316,7 @@ export interface GraphQLField<TSource, TContext> {
|
||||
resolve?: GraphQLFieldResolver<TSource, TContext>;
|
||||
isDeprecated?: boolean;
|
||||
deprecationReason?: string;
|
||||
astNode?: FieldDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLArgument {
|
||||
@@ -305,6 +324,7 @@ export interface GraphQLArgument {
|
||||
type: GraphQLInputType;
|
||||
defaultValue?: any;
|
||||
description?: string;
|
||||
astNode?: InputValueDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLFieldMap<TSource, TContext> {
|
||||
@@ -332,6 +352,7 @@ export interface GraphQLFieldMap<TSource, TContext> {
|
||||
export class GraphQLInterfaceType {
|
||||
name: string;
|
||||
description: string;
|
||||
astNode?: InterfaceTypeDefinitionNode;
|
||||
resolveType: GraphQLTypeResolver<any, any>;
|
||||
|
||||
constructor(config: GraphQLInterfaceTypeConfig<any, any>);
|
||||
@@ -351,6 +372,7 @@ export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
|
||||
*/
|
||||
resolveType?: GraphQLTypeResolver<TSource, TContext>;
|
||||
description?: string;
|
||||
astNode?: InterfaceTypeDefinitionNode;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,6 +401,7 @@ export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
|
||||
export class GraphQLUnionType {
|
||||
name: string;
|
||||
description: string;
|
||||
astNode?: UnionTypeDefinitionNode;
|
||||
resolveType: GraphQLTypeResolver<any, any>;
|
||||
|
||||
constructor(config: GraphQLUnionTypeConfig<any, any>);
|
||||
@@ -398,6 +421,7 @@ export interface GraphQLUnionTypeConfig<TSource, TContext> {
|
||||
*/
|
||||
resolveType?: GraphQLTypeResolver<TSource, TContext>;
|
||||
description?: string;
|
||||
astNode?: UnionTypeDefinitionNode;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,6 +448,7 @@ export interface GraphQLUnionTypeConfig<TSource, TContext> {
|
||||
export class GraphQLEnumType {
|
||||
name: string;
|
||||
description: string;
|
||||
astNode?: EnumTypeDefinitionNode;
|
||||
|
||||
constructor(config: GraphQLEnumTypeConfig);
|
||||
getValues(): GraphQLEnumValue[];
|
||||
@@ -438,6 +463,7 @@ export interface GraphQLEnumTypeConfig {
|
||||
name: string;
|
||||
values: GraphQLEnumValueConfigMap;
|
||||
description?: string;
|
||||
astNode?: EnumTypeDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLEnumValueConfigMap {
|
||||
@@ -448,6 +474,7 @@ export interface GraphQLEnumValueConfig {
|
||||
value?: any;
|
||||
deprecationReason?: string;
|
||||
description?: string;
|
||||
astNode?: EnumValueDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLEnumValue {
|
||||
@@ -455,6 +482,7 @@ export interface GraphQLEnumValue {
|
||||
description: string;
|
||||
isDeprecated?: boolean;
|
||||
deprecationReason: string;
|
||||
astNode?: EnumValueDefinitionNode;
|
||||
value: any;
|
||||
}
|
||||
|
||||
@@ -481,6 +509,7 @@ export interface GraphQLEnumValue {
|
||||
export class GraphQLInputObjectType {
|
||||
name: string;
|
||||
description: string;
|
||||
astNode?: InputObjectTypeDefinitionNode;
|
||||
constructor(config: GraphQLInputObjectTypeConfig);
|
||||
getFields(): GraphQLInputFieldMap;
|
||||
toString(): string;
|
||||
@@ -490,12 +519,14 @@ export interface GraphQLInputObjectTypeConfig {
|
||||
name: string;
|
||||
fields: Thunk<GraphQLInputFieldConfigMap>;
|
||||
description?: string;
|
||||
astNode?: InputObjectTypeDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLInputFieldConfig {
|
||||
type: GraphQLInputType;
|
||||
defaultValue?: any;
|
||||
description?: string;
|
||||
astNode?: InputValueDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLInputFieldConfigMap {
|
||||
@@ -507,6 +538,7 @@ export interface GraphQLInputField {
|
||||
type: GraphQLInputType;
|
||||
defaultValue?: any;
|
||||
description?: string;
|
||||
astNode?: InputValueDefinitionNode;
|
||||
}
|
||||
|
||||
export interface GraphQLInputFieldMap {
|
||||
|
||||
Vendored
+4
-1
@@ -2,6 +2,7 @@ import {
|
||||
GraphQLFieldConfigArgumentMap,
|
||||
GraphQLArgument
|
||||
} from './definition';
|
||||
import { DirectiveDefinitionNode } from '../language/ast';
|
||||
|
||||
export const DirectiveLocation: {
|
||||
// Operations
|
||||
@@ -34,9 +35,10 @@ export type DirectiveLocationEnum = keyof typeof DirectiveLocation;
|
||||
*/
|
||||
export class GraphQLDirective {
|
||||
name: string;
|
||||
description: string;
|
||||
description?: string;
|
||||
locations: DirectiveLocationEnum[];
|
||||
args: GraphQLArgument[];
|
||||
astNode?: DirectiveDefinitionNode;
|
||||
|
||||
constructor(config: GraphQLDirectiveConfig);
|
||||
}
|
||||
@@ -46,6 +48,7 @@ export interface GraphQLDirectiveConfig {
|
||||
description?: string;
|
||||
locations: DirectiveLocationEnum[];
|
||||
args?: GraphQLFieldConfigArgumentMap;
|
||||
astNode?: DirectiveDefinitionNode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+5
@@ -6,6 +6,9 @@ import {
|
||||
GraphQLNamedType,
|
||||
GraphQLAbstractType
|
||||
} from './definition';
|
||||
import {
|
||||
SchemaDefinitionNode
|
||||
} from '../language/ast';
|
||||
import {
|
||||
GraphQLDirective,
|
||||
} from './directives';
|
||||
@@ -37,6 +40,7 @@ import {
|
||||
*
|
||||
*/
|
||||
export class GraphQLSchema {
|
||||
astNode?: SchemaDefinitionNode;
|
||||
// private _queryType: GraphQLObjectType;
|
||||
// private _mutationType: GraphQLObjectType;
|
||||
// private _subscriptionType: GraphQLObjectType;
|
||||
@@ -69,4 +73,5 @@ export interface GraphQLSchemaConfig {
|
||||
subscription?: GraphQLObjectType;
|
||||
types?: GraphQLNamedType[];
|
||||
directives?: GraphQLDirective[];
|
||||
astNode?: SchemaDefinitionNode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user