@@ -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 ) ;
@@ -804,6 +811,20 @@ describe('Schema Builder', () => {
804
811
const field4OldArg = rootFields . field4 . args [ 0 ] ;
805
812
expect ( field4OldArg . isDeprecated ) . to . equal ( true ) ;
806
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' ) ;
807
828
} ) ;
808
829
809
830
it ( 'Correctly extend object type' , ( ) => {
0 commit comments