@@ -21,6 +21,7 @@ import {
2121 GraphQLDeprecatedDirective ,
2222 GraphQLSpecifiedByDirective ,
2323 GraphQLDeferDirective ,
24+ GraphQLStreamDirective ,
2425} from '../../type/directives' ;
2526import {
2627 GraphQLID ,
@@ -158,8 +159,7 @@ describe('Schema Builder', () => {
158159 it ( 'include standard type only if it is used' , ( ) => {
159160 const schema = buildSchema ( 'type Query' ) ;
160161
161- // String and Boolean are always included through introspection types
162- expect ( schema . getType ( 'Int' ) ) . to . equal ( undefined ) ;
162+ // String, Boolean, and Int are always included through introspection types
163163 expect ( schema . getType ( 'Float' ) ) . to . equal ( undefined ) ;
164164 expect ( schema . getType ( 'ID' ) ) . to . equal ( undefined ) ;
165165 } ) ;
@@ -225,10 +225,11 @@ describe('Schema Builder', () => {
225225 it ( 'Maintains specified directives' , ( ) => {
226226 const schema = buildSchema ( 'type Query' ) ;
227227
228- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 5 ) ;
228+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
229229 expect ( schema . getDirective ( 'skip' ) ) . to . equal ( GraphQLSkipDirective ) ;
230230 expect ( schema . getDirective ( 'include' ) ) . to . equal ( GraphQLIncludeDirective ) ;
231231 expect ( schema . getDirective ( 'defer' ) ) . to . equal ( GraphQLDeferDirective ) ;
232+ expect ( schema . getDirective ( 'stream' ) ) . to . equal ( GraphQLStreamDirective ) ;
232233 expect ( schema . getDirective ( 'deprecated' ) ) . to . equal (
233234 GraphQLDeprecatedDirective ,
234235 ) ;
@@ -244,9 +245,10 @@ describe('Schema Builder', () => {
244245 directive @deprecated on FIELD_DEFINITION
245246 directive @specifiedBy on FIELD_DEFINITION
246247 directive @defer on FRAGMENT_SPREAD
248+ directive @stream on FIELD
247249 ` ) ;
248250
249- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 5 ) ;
251+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
250252 expect ( schema . getDirective ( 'skip' ) ) . to . not . equal ( GraphQLSkipDirective ) ;
251253 expect ( schema . getDirective ( 'include' ) ) . to . not . equal (
252254 GraphQLIncludeDirective ,
@@ -258,17 +260,19 @@ describe('Schema Builder', () => {
258260 GraphQLSpecifiedByDirective ,
259261 ) ;
260262 expect ( schema . getDirective ( 'defer' ) ) . to . not . equal ( GraphQLDeferDirective ) ;
263+ expect ( schema . getDirective ( 'stream' ) ) . to . not . equal ( GraphQLStreamDirective ) ;
261264 } ) ;
262265
263266 it ( 'Adding directives maintains specified directives' , ( ) => {
264267 const schema = buildSchema ( `
265268 directive @foo(arg: Int) on FIELD
266269 ` ) ;
267270
268- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
271+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 7 ) ;
269272 expect ( schema . getDirective ( 'skip' ) ) . to . not . equal ( undefined ) ;
270273 expect ( schema . getDirective ( 'include' ) ) . to . not . equal ( undefined ) ;
271274 expect ( schema . getDirective ( 'defer' ) ) . to . not . equal ( undefined ) ;
275+ expect ( schema . getDirective ( 'stream' ) ) . to . not . equal ( undefined ) ;
272276 expect ( schema . getDirective ( 'deprecated' ) ) . to . not . equal ( undefined ) ;
273277 expect ( schema . getDirective ( 'specifiedBy' ) ) . to . not . equal ( undefined ) ;
274278 } ) ;
0 commit comments