@@ -21,6 +21,7 @@ import {
21
21
GraphQLDeprecatedDirective ,
22
22
GraphQLSpecifiedByDirective ,
23
23
GraphQLDeferDirective ,
24
+ GraphQLStreamDirective ,
24
25
} from '../../type/directives' ;
25
26
import {
26
27
GraphQLID ,
@@ -162,8 +163,7 @@ describe('Schema Builder', () => {
162
163
it ( 'include standard type only if it is used' , ( ) => {
163
164
const schema = buildSchema ( 'type Query' ) ;
164
165
165
- // String and Boolean are always included through introspection types
166
- expect ( schema . getType ( 'Int' ) ) . to . equal ( undefined ) ;
166
+ // String, Boolean, and Int are always included through introspection types
167
167
expect ( schema . getType ( 'Float' ) ) . to . equal ( undefined ) ;
168
168
expect ( schema . getType ( 'ID' ) ) . to . equal ( undefined ) ;
169
169
} ) ;
@@ -255,10 +255,11 @@ describe('Schema Builder', () => {
255
255
it ( 'Maintains specified directives' , ( ) => {
256
256
const schema = buildSchema ( 'type Query' ) ;
257
257
258
- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 5 ) ;
258
+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
259
259
expect ( schema . getDirective ( 'skip' ) ) . to . equal ( GraphQLSkipDirective ) ;
260
260
expect ( schema . getDirective ( 'include' ) ) . to . equal ( GraphQLIncludeDirective ) ;
261
261
expect ( schema . getDirective ( 'defer' ) ) . to . equal ( GraphQLDeferDirective ) ;
262
+ expect ( schema . getDirective ( 'stream' ) ) . to . equal ( GraphQLStreamDirective ) ;
262
263
expect ( schema . getDirective ( 'deprecated' ) ) . to . equal (
263
264
GraphQLDeprecatedDirective ,
264
265
) ;
@@ -274,9 +275,10 @@ describe('Schema Builder', () => {
274
275
directive @deprecated on FIELD_DEFINITION
275
276
directive @specifiedBy on FIELD_DEFINITION
276
277
directive @defer on FRAGMENT_SPREAD
278
+ directive @stream on FIELD
277
279
` ) ;
278
280
279
- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 5 ) ;
281
+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
280
282
expect ( schema . getDirective ( 'skip' ) ) . to . not . equal ( GraphQLSkipDirective ) ;
281
283
expect ( schema . getDirective ( 'include' ) ) . to . not . equal (
282
284
GraphQLIncludeDirective ,
@@ -288,17 +290,19 @@ describe('Schema Builder', () => {
288
290
GraphQLSpecifiedByDirective ,
289
291
) ;
290
292
expect ( schema . getDirective ( 'defer' ) ) . to . not . equal ( GraphQLDeferDirective ) ;
293
+ expect ( schema . getDirective ( 'stream' ) ) . to . not . equal ( GraphQLStreamDirective ) ;
291
294
} ) ;
292
295
293
296
it ( 'Adding directives maintains specified directives' , ( ) => {
294
297
const schema = buildSchema ( `
295
298
directive @foo(arg: Int) on FIELD
296
299
` ) ;
297
300
298
- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
301
+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 7 ) ;
299
302
expect ( schema . getDirective ( 'skip' ) ) . to . not . equal ( undefined ) ;
300
303
expect ( schema . getDirective ( 'include' ) ) . to . not . equal ( undefined ) ;
301
304
expect ( schema . getDirective ( 'defer' ) ) . to . not . equal ( undefined ) ;
305
+ expect ( schema . getDirective ( 'stream' ) ) . to . not . equal ( undefined ) ;
302
306
expect ( schema . getDirective ( 'deprecated' ) ) . to . not . equal ( undefined ) ;
303
307
expect ( schema . getDirective ( 'specifiedBy' ) ) . to . not . equal ( undefined ) ;
304
308
} ) ;
0 commit comments