1
- import { GraphQLList , GraphQLType , GraphQLObjectType , GraphQLNonNull , GraphQLArgument , GraphQLFieldResolver , FieldDefinitionNode , GraphQLNamedType , GraphQLInterfaceType } from 'graphql'
1
+ import { GraphQLList , GraphQLType , GraphQLObjectType , GraphQLNonNull , GraphQLArgument , GraphQLFieldResolver , FieldDefinitionNode , InputValueDefinitionNode , GraphQLNamedType , GraphQLInterfaceType , StringValueNode , NameNode , TypeNode , DirectiveNode , ValueNode } from 'graphql'
2
2
3
3
export interface cacheCallback < T > {
4
4
( key ) : T
@@ -29,7 +29,7 @@ export function setSuffix(text: string, locate: string, replaceWith: string): st
29
29
: `${ text } ${ replaceWith } ` ;
30
30
}
31
31
32
- export interface FieldExtensions {
32
+ export type FieldExtensions = {
33
33
graphqlToMongoDb ?: { dependencies : string [ ] }
34
34
}
35
35
@@ -45,6 +45,17 @@ export interface FieldMap<T extends GraphQLType> {
45
45
[ key : string ] : Field < T , any , any > & { type : T }
46
46
}
47
47
48
+ export interface AstNodeType {
49
+ readonly kind : any ;
50
+ readonly loc ?: any ;
51
+ readonly description ?: StringValueNode ;
52
+ readonly name : NameNode ;
53
+ readonly arguments ?: ReadonlyArray < InputValueDefinitionNode > ;
54
+ readonly type : TypeNode ;
55
+ readonly directives ?: ReadonlyArray < DirectiveNode > ;
56
+ readonly defaultValue ?: ValueNode ;
57
+ }
58
+
48
59
export interface Field < TType extends GraphQLType ,
49
60
TSource ,
50
61
TContext ,
@@ -53,12 +64,12 @@ export interface Field<TType extends GraphQLType,
53
64
name ?: string ;
54
65
description ?: string ;
55
66
type : TType ;
56
- args ?: GraphQLArgument [ ] ;
67
+ args ?: readonly GraphQLArgument [ ] ;
57
68
resolve ?: GraphQLFieldResolver < TSource , TContext , TArgs > ;
58
69
subscribe ?: GraphQLFieldResolver < TSource , TContext , TArgs > ;
59
70
isDeprecated ?: boolean ;
60
71
deprecationReason ?: string ;
61
- astNode ?: FieldDefinitionNode ;
72
+ astNode ?: AstNodeType ;
62
73
extensions ?: FieldExtensions
63
74
}
64
75
0 commit comments