@@ -777,6 +777,29 @@ describe('Schema Builder', () => {
777777 isDeprecated : true ,
778778 deprecationReason : 'Because I said so' ,
779779 } ) ;
780+
781+ const inputFields = assertInputObjectType (
782+ schema . getType ( 'MyInput' ) ,
783+ ) . getFields ( ) ;
784+
785+ const newInput = inputFields . newInput ;
786+ expect ( newInput . isDeprecated ) . to . equal ( false ) ;
787+
788+ const oldInput = inputFields . oldInput ;
789+ expect ( oldInput . isDeprecated ) . to . equal ( true ) ;
790+ expect ( oldInput . deprecationReason ) . to . equal ( 'No longer supported' ) ;
791+
792+ const otherInput = inputFields . otherInput ;
793+ expect ( otherInput . isDeprecated ) . to . equal ( true ) ;
794+ expect ( otherInput . deprecationReason ) . to . equal ( 'Use newInput' ) ;
795+
796+ const field3OldArg = rootFields . field3 . args [ 0 ] ;
797+ expect ( field3OldArg . isDeprecated ) . to . equal ( true ) ;
798+ expect ( field3OldArg . deprecationReason ) . to . equal ( 'No longer supported' ) ;
799+
800+ const field4OldArg = rootFields . field4 . args [ 0 ] ;
801+ expect ( field4OldArg . isDeprecated ) . to . equal ( true ) ;
802+ expect ( field4OldArg . deprecationReason ) . to . equal ( 'why not?' ) ;
780803 } ) ;
781804
782805 it ( 'Correctly extend scalar type' , ( ) => {
@@ -799,32 +822,6 @@ describe('Schema Builder', () => {
799822 ` ) ;
800823
801824 expect ( printAllASTNodes ( someScalar ) ) . to . equal ( scalarSDL ) ;
802- const rootFields = assertObjectType ( schema . getType ( 'Query' ) ) . getFields ( ) ;
803-
804- expect ( rootFields . field2 . isDeprecated ) . to . equal ( true ) ;
805- expect ( rootFields . field2 . deprecationReason ) . to . equal ( 'Because I said so' ) ;
806-
807- const field3OldArg = rootFields . field3 . args [ 0 ] ;
808- expect ( field3OldArg . isDeprecated ) . to . equal ( true ) ;
809- expect ( field3OldArg . deprecationReason ) . to . equal ( 'No longer supported' ) ;
810-
811- const field4OldArg = rootFields . field4 . args [ 0 ] ;
812- expect ( field4OldArg . isDeprecated ) . to . equal ( true ) ;
813- expect ( field4OldArg . deprecationReason ) . to . equal ( 'why not?' ) ;
814-
815- const myInput = schema . getType ( 'MyInput' ) ;
816- const inputFields = myInput . getFields ( ) ;
817-
818- const newInput = inputFields . newInput ;
819- expect ( newInput . isDeprecated ) . to . equal ( false ) ;
820-
821- const oldInput = inputFields . oldInput ;
822- expect ( oldInput . isDeprecated ) . to . equal ( true ) ;
823- expect ( oldInput . deprecationReason ) . to . equal ( 'No longer supported' ) ;
824-
825- const otherInput = inputFields . otherInput ;
826- expect ( otherInput . isDeprecated ) . to . equal ( true ) ;
827- expect ( otherInput . deprecationReason ) . to . equal ( 'Use newInput' ) ;
828825 } ) ;
829826
830827 it ( 'Correctly extend object type' , ( ) => {
0 commit comments