@@ -20,6 +20,7 @@ import {
2020 GraphQLDeprecatedDirective ,
2121 GraphQLSpecifiedByDirective ,
2222 GraphQLDeferDirective ,
23+ GraphQLStreamDirective ,
2324} from '../../type/directives' ;
2425import {
2526 GraphQLID ,
@@ -156,8 +157,7 @@ describe('Schema Builder', () => {
156157 it ( 'include standard type only if it is used' , ( ) => {
157158 const schema = buildSchema ( 'type Query' ) ;
158159
159- // String and Boolean are always included through introspection types
160- expect ( schema . getType ( 'Int' ) ) . to . equal ( undefined ) ;
160+ // String, Boolean, and Int are always included through introspection types
161161 expect ( schema . getType ( 'Float' ) ) . to . equal ( undefined ) ;
162162 expect ( schema . getType ( 'ID' ) ) . to . equal ( undefined ) ;
163163 } ) ;
@@ -223,10 +223,11 @@ describe('Schema Builder', () => {
223223 it ( 'Maintains specified directives' , ( ) => {
224224 const schema = buildSchema ( 'type Query' ) ;
225225
226- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 5 ) ;
226+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
227227 expect ( schema . getDirective ( 'skip' ) ) . to . equal ( GraphQLSkipDirective ) ;
228228 expect ( schema . getDirective ( 'include' ) ) . to . equal ( GraphQLIncludeDirective ) ;
229229 expect ( schema . getDirective ( 'defer' ) ) . to . equal ( GraphQLDeferDirective ) ;
230+ expect ( schema . getDirective ( 'stream' ) ) . to . equal ( GraphQLStreamDirective ) ;
230231 expect ( schema . getDirective ( 'deprecated' ) ) . to . equal (
231232 GraphQLDeprecatedDirective ,
232233 ) ;
@@ -242,9 +243,10 @@ describe('Schema Builder', () => {
242243 directive @deprecated on FIELD_DEFINITION
243244 directive @specifiedBy on FIELD_DEFINITION
244245 directive @defer on FRAGMENT_SPREAD
246+ directive @stream on FIELD
245247 ` ) ;
246248
247- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 5 ) ;
249+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
248250 expect ( schema . getDirective ( 'skip' ) ) . to . not . equal ( GraphQLSkipDirective ) ;
249251 expect ( schema . getDirective ( 'include' ) ) . to . not . equal (
250252 GraphQLIncludeDirective ,
@@ -256,17 +258,19 @@ describe('Schema Builder', () => {
256258 GraphQLSpecifiedByDirective ,
257259 ) ;
258260 expect ( schema . getDirective ( 'defer' ) ) . to . not . equal ( GraphQLDeferDirective ) ;
261+ expect ( schema . getDirective ( 'stream' ) ) . to . not . equal ( GraphQLStreamDirective ) ;
259262 } ) ;
260263
261264 it ( 'Adding directives maintains specified directives' , ( ) => {
262265 const schema = buildSchema ( `
263266 directive @foo(arg: Int) on FIELD
264267 ` ) ;
265268
266- expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 6 ) ;
269+ expect ( schema . getDirectives ( ) ) . to . have . lengthOf ( 7 ) ;
267270 expect ( schema . getDirective ( 'skip' ) ) . to . not . equal ( undefined ) ;
268271 expect ( schema . getDirective ( 'include' ) ) . to . not . equal ( undefined ) ;
269272 expect ( schema . getDirective ( 'defer' ) ) . to . not . equal ( undefined ) ;
273+ expect ( schema . getDirective ( 'stream' ) ) . to . not . equal ( undefined ) ;
270274 expect ( schema . getDirective ( 'deprecated' ) ) . to . not . equal ( undefined ) ;
271275 expect ( schema . getDirective ( 'specifiedBy' ) ) . to . not . equal ( undefined ) ;
272276 } ) ;
0 commit comments