File tree 1 file changed +33
-0
lines changed 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,39 @@ type Hello {
104
104
expect ( printJson ( doc ) ) . to . equal ( printJson ( expected ) ) ;
105
105
} ) ;
106
106
107
+ it ( 'Simple extension' , ( ) => {
108
+ var body = `
109
+ extend type Hello {
110
+ world: String
111
+ }` ;
112
+ var doc = parse ( body ) ;
113
+ var loc = createLocFn ( body ) ;
114
+ var expected = {
115
+ kind : 'Document' ,
116
+ definitions : [
117
+ {
118
+ kind : 'TypeExtensionDefinition' ,
119
+ definition : {
120
+ kind : 'ObjectTypeDefinition' ,
121
+ name : nameNode ( 'Hello' , loc ( 13 , 18 ) ) ,
122
+ interfaces : [ ] ,
123
+ fields : [
124
+ fieldNode (
125
+ nameNode ( 'world' , loc ( 23 , 28 ) ) ,
126
+ typeNode ( 'String' , loc ( 30 , 36 ) ) ,
127
+ loc ( 23 , 36 )
128
+ )
129
+ ] ,
130
+ loc : loc ( 8 , 38 ) ,
131
+ } ,
132
+ loc : loc ( 1 , 38 ) ,
133
+ }
134
+ ] ,
135
+ loc : loc ( 1 , 38 )
136
+ } ;
137
+ expect ( printJson ( doc ) ) . to . equal ( printJson ( expected ) ) ;
138
+ } ) ;
139
+
107
140
it ( 'Simple non-null type' , ( ) => {
108
141
var body = `
109
142
type Hello {
You can’t perform that action at this time.
0 commit comments