@@ -732,12 +732,19 @@ describe('Schema Builder', () => {
732
732
OTHER_VALUE @deprecated(reason: "Terrible reasons")
733
733
}
734
734
735
+ input MyInput {
736
+ oldInput: String @deprecated
737
+ otherInput: String @deprecated(reason: "Use newInput")
738
+ newInput: String
739
+ }
740
+
735
741
type Query {
736
742
field1: String @deprecated
737
743
field2: Int @deprecated(reason: "Because I said so")
738
744
enum: MyEnum
739
745
field3(oldArg: String @deprecated, arg: String): String
740
746
field4(oldArg: String @deprecated(reason: "why not?"), arg: String): String
747
+ field5(arg: MyInput): String
741
748
}
742
749
` ;
743
750
expect ( cycleSDL ( sdl ) ) . to . equal ( sdl ) ;
@@ -802,6 +809,20 @@ describe('Schema Builder', () => {
802
809
const field4OldArg = rootFields . field4 . args [ 0 ] ;
803
810
expect ( field4OldArg . isDeprecated ) . to . equal ( true ) ;
804
811
expect ( field4OldArg . deprecationReason ) . to . equal ( 'why not?' ) ;
812
+
813
+ const myInput = schema . getType ( 'MyInput' ) ;
814
+ const inputFields = myInput . getFields ( ) ;
815
+
816
+ const newInput = inputFields . newInput ;
817
+ expect ( newInput . isDeprecated ) . to . equal ( false ) ;
818
+
819
+ const oldInput = inputFields . oldInput ;
820
+ expect ( oldInput . isDeprecated ) . to . equal ( true ) ;
821
+ expect ( oldInput . deprecationReason ) . to . equal ( 'No longer supported' ) ;
822
+
823
+ const otherInput = inputFields . otherInput ;
824
+ expect ( otherInput . isDeprecated ) . to . equal ( true ) ;
825
+ expect ( otherInput . deprecationReason ) . to . equal ( 'Use newInput' ) ;
805
826
} ) ;
806
827
807
828
it ( 'Correctly extend object type' , ( ) => {
0 commit comments