@@ -627,12 +627,19 @@ describe('Schema Builder', () => {
627
627
OTHER_VALUE @deprecated(reason: "Terrible reasons")
628
628
}
629
629
630
+ input MyInput {
631
+ oldInput: String @deprecated
632
+ otherInput: String @deprecated(reason: "Use newInput")
633
+ newInput: String
634
+ }
635
+
630
636
type Query {
631
637
field1: String @deprecated
632
638
field2: Int @deprecated(reason: "Because I said so")
633
639
enum: MyEnum
634
640
field3(oldArg: String @deprecated, arg: String): String
635
641
field4(oldArg: String @deprecated(reason: "why not?"), arg: String): String
642
+ field5(arg: MyInput): String
636
643
}
637
644
` ;
638
645
const output = cycleOutput ( body ) ;
@@ -668,6 +675,20 @@ describe('Schema Builder', () => {
668
675
const field4OldArg = rootFields . field4 . args [ 0 ] ;
669
676
expect ( field4OldArg . isDeprecated ) . to . equal ( true ) ;
670
677
expect ( field4OldArg . deprecationReason ) . to . equal ( 'why not?' ) ;
678
+
679
+ const myInput = schema . getType ( 'MyInput' ) ;
680
+ const inputFields = myInput . getFields ( ) ;
681
+
682
+ const newInput = inputFields . newInput ;
683
+ expect ( newInput . isDeprecated ) . to . equal ( false ) ;
684
+
685
+ const oldInput = inputFields . oldInput ;
686
+ expect ( oldInput . isDeprecated ) . to . equal ( true ) ;
687
+ expect ( oldInput . deprecationReason ) . to . equal ( 'No longer supported' ) ;
688
+
689
+ const otherInput = inputFields . otherInput ;
690
+ expect ( otherInput . isDeprecated ) . to . equal ( true ) ;
691
+ expect ( otherInput . deprecationReason ) . to . equal ( 'Use newInput' ) ;
671
692
} ) ;
672
693
673
694
it ( 'Correctly assign AST nodes' , ( ) => {
0 commit comments