File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
packages/graphql-language-service/src/parser/__tests__ Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,49 @@ describe('onlineParser', () => {
66
66
67
67
t . eol ( ) ;
68
68
} ) ;
69
+
70
+ it ( 'parses schema extension bare' , ( ) => {
71
+ const { t } = getUtils ( `
72
+ extend schema
73
+ ` ) ;
74
+
75
+ t . keyword ( 'extend' , { kind : 'ExtendDef' } ) ;
76
+ t . keyword ( 'schema' , { kind : 'SchemaDef' } ) ;
77
+
78
+ t . eol ( ) ;
79
+ } ) ;
80
+
81
+ it ( 'parses schema extension with operation defs' , ( ) => {
82
+ const { t } = getUtils ( `
83
+ extend schema {
84
+ query: SomeType
85
+ }
86
+ ` ) ;
87
+
88
+ t . keyword ( 'extend' , { kind : 'ExtendDef' } ) ;
89
+ t . keyword ( 'schema' , { kind : 'SchemaDef' } ) ;
90
+ t . punctuation ( '{' ) ;
91
+
92
+ t . keyword ( 'query' , { kind : 'OperationTypeDef' } ) ;
93
+ t . punctuation ( ':' ) ;
94
+ t . name ( 'SomeType' ) ;
95
+
96
+ t . punctuation ( '}' , { kind : 'Document' } ) ;
97
+
98
+ t . eol ( ) ;
99
+ } ) ;
100
+
101
+ it ( 'parses schema extension with directive applications' , ( ) => {
102
+ const { t } = getUtils ( `
103
+ extend schema @someDirective
104
+ ` ) ;
105
+
106
+ t . keyword ( 'extend' , { kind : 'ExtendDef' } ) ;
107
+ t . keyword ( 'schema' , { kind : 'SchemaDef' } ) ;
108
+ expectDirective ( { t } , { name : 'someDirective' } ) ;
109
+
110
+ t . eol ( ) ;
111
+ } ) ;
69
112
70
113
it ( 'parses short query' , ( ) => {
71
114
const { t } = getUtils ( `
You can’t perform that action at this time.
0 commit comments