File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import {
10
10
GraphQLInterfaceType ,
11
11
GraphQLObjectType ,
12
12
GraphQLString ,
13
+ GraphQLInputObjectType ,
14
+ GraphQLDirective ,
13
15
} from '../' ;
14
16
15
17
import { describe , it } from 'mocha' ;
@@ -26,6 +28,25 @@ const ImplementingType = new GraphQLObjectType({
26
28
fields : { fieldName : { type : GraphQLString , resolve : ( ) => '' } } ,
27
29
} ) ;
28
30
31
+ const DirectiveInputType = new GraphQLInputObjectType ( {
32
+ name : 'DirInput' ,
33
+ fields : {
34
+ field : {
35
+ type : GraphQLString ,
36
+ } ,
37
+ } ,
38
+ } ) ;
39
+
40
+ const Directive = new GraphQLDirective ( {
41
+ name : 'dir' ,
42
+ locations : [ 'OBJECT' ] ,
43
+ args : {
44
+ arg : {
45
+ type : DirectiveInputType ,
46
+ } ,
47
+ } ,
48
+ } ) ;
49
+
29
50
const Schema = new GraphQLSchema ( {
30
51
query : new GraphQLObjectType ( {
31
52
name : 'Query' ,
@@ -38,6 +59,7 @@ const Schema = new GraphQLSchema({
38
59
} ,
39
60
} ,
40
61
} ) ,
62
+ directives : [ Directive ] ,
41
63
} ) ;
42
64
43
65
describe ( 'Type System: Schema' , ( ) => {
@@ -53,4 +75,10 @@ describe('Type System: Schema', () => {
53
75
) ;
54
76
} ) ;
55
77
} ) ;
78
+
79
+ describe ( 'Type Map' , ( ) => {
80
+ it ( 'includes input types only used in directives' , ( ) => {
81
+ expect ( Schema . getTypeMap ( ) [ 'DirInput' ] ) . toBeDefined ( ) ;
82
+ } ) ;
83
+ } ) ;
56
84
} ) ;
You can’t perform that action at this time.
0 commit comments