@@ -21,6 +21,7 @@ import {
2121 GraphQLDeprecatedDirective ,
2222 GraphQLSpecifiedByDirective ,
2323 GraphQLDeferDirective ,
24+ GraphQLStreamDirective ,
2425} from '../../type/directives' ;
2526import {
2627 GraphQLID ,
@@ -162,8 +163,7 @@ describe('Schema Builder', () => {
162163 it ( 'include standard type only if it is used' , ( ) => {
163164 const schema = buildSchema ( 'type Query' ) ;
164165
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
167167 expect ( schema . getType ( 'Float' ) ) . to . equal ( undefined ) ;
168168 expect ( schema . getType ( 'ID' ) ) . to . equal ( undefined ) ;
169169 } ) ;
@@ -255,10 +255,11 @@ describe('Schema Builder', () => {
255255 it ( 'Maintains specified directives' , ( ) => {
256256 const schema = buildSchema ( 'type Query' ) ;
257257
258- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 5 ) ;
258+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
259259 expect ( schema . getDirective ( 'skip' ) ) . to . equal ( GraphQLSkipDirective ) ;
260260 expect ( schema . getDirective ( 'include' ) ) . to . equal ( GraphQLIncludeDirective ) ;
261261 expect ( schema . getDirective ( 'defer' ) ) . to . equal ( GraphQLDeferDirective ) ;
262+ expect ( schema . getDirective ( 'stream' ) ) . to . equal ( GraphQLStreamDirective ) ;
262263 expect ( schema . getDirective ( 'deprecated' ) ) . to . equal (
263264 GraphQLDeprecatedDirective ,
264265 ) ;
@@ -274,9 +275,10 @@ describe('Schema Builder', () => {
274275 directive @deprecated on FIELD_DEFINITION
275276 directive @specifiedBy on FIELD_DEFINITION
276277 directive @defer on FRAGMENT_SPREAD
278+ directive @stream on FIELD
277279 ` ) ;
278280
279- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 5 ) ;
281+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
280282 expect ( schema . getDirective ( 'skip' ) ) . to . not . equal ( GraphQLSkipDirective ) ;
281283 expect ( schema . getDirective ( 'include' ) ) . to . not . equal (
282284 GraphQLIncludeDirective ,
@@ -288,17 +290,19 @@ describe('Schema Builder', () => {
288290 GraphQLSpecifiedByDirective ,
289291 ) ;
290292 expect ( schema . getDirective ( 'defer' ) ) . to . not . equal ( GraphQLDeferDirective ) ;
293+ expect ( schema . getDirective ( 'stream' ) ) . to . not . equal ( GraphQLStreamDirective ) ;
291294 } ) ;
292295
293296 it ( 'Adding directives maintains specified directives' , ( ) => {
294297 const schema = buildSchema ( `
295298 directive @foo(arg: Int) on FIELD
296299 ` ) ;
297300
298- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
301+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 7 ) ;
299302 expect ( schema . getDirective ( 'skip' ) ) . to . not . equal ( undefined ) ;
300303 expect ( schema . getDirective ( 'include' ) ) . to . not . equal ( undefined ) ;
301304 expect ( schema . getDirective ( 'defer' ) ) . to . not . equal ( undefined ) ;
305+ expect ( schema . getDirective ( 'stream' ) ) . to . not . equal ( undefined ) ;
302306 expect ( schema . getDirective ( 'deprecated' ) ) . to . not . equal ( undefined ) ;
303307 expect ( schema . getDirective ( 'specifiedBy' ) ) . to . not . equal ( undefined ) ;
304308 } ) ;
0 commit comments