File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ type Query {
2
+ persons (filter : PersonFilter @deprecated (reason : " Do not use this arg" )): [Person ]
3
+ }
4
+
5
+ input PersonFilter {
6
+ namePattern : String @deprecated (reason : " Do not use this field" )
7
+ }
8
+
9
+ type Person {
10
+ name : String
11
+ }
Original file line number Diff line number Diff line change @@ -1679,4 +1679,26 @@ directive @TestDirective (
1679
1679
if ( parseComments )
1680
1680
directiveDef . Arguments [ 0 ] . Comment . Value . ShouldBe ( " comment 29" ) ;
1681
1681
}
1682
+
1683
+ // https://github.com/graphql/graphql-spec/pull/805
1684
+ [ Fact ]
1685
+ public void Should_Parse_Deprecations_On_Arg_And_InputField ( )
1686
+ {
1687
+ string text = "DeprecatedOnArgAndInputField" . ReadGraphQLFile ( ) ;
1688
+ var document = text . Parse ( ) ;
1689
+
1690
+ var queryDef = document . Definitions . First ( x => x is GraphQLObjectTypeDefinition ) as GraphQLObjectTypeDefinition ;
1691
+ queryDef . Name . Value . ShouldBe ( "Query" ) ;
1692
+ var arg = queryDef . Fields [ 0 ] . Arguments [ 0 ] ;
1693
+ var dir1 = arg . Directives . ShouldNotBeNull ( ) [ 0 ] ;
1694
+ dir1 . Name . Value . ShouldBe ( "deprecated" ) ;
1695
+ dir1 . Arguments . ShouldNotBeNull ( ) [ 0 ] . Value . ShouldBeAssignableTo < GraphQLStringValue > ( ) . Value . ShouldBe ( "Do not use this arg" ) ;
1696
+
1697
+ var inputDef = document . Definitions . First ( x => x is GraphQLInputObjectTypeDefinition ) as GraphQLInputObjectTypeDefinition ;
1698
+ inputDef . Name . Value . ShouldBe ( "PersonFilter" ) ;
1699
+ var field = inputDef . Fields [ 0 ] . ShouldNotBeNull ( ) ;
1700
+ var dir2 = field . Directives . ShouldNotBeNull ( ) [ 0 ] ;
1701
+ dir2 . Name . Value . ShouldBe ( "deprecated" ) ;
1702
+ dir2 . Arguments . ShouldNotBeNull ( ) [ 0 ] . Value . ShouldBeAssignableTo < GraphQLStringValue > ( ) . Value . ShouldBe ( "Do not use this field" ) ;
1703
+ }
1682
1704
}
You can’t perform that action at this time.
0 commit comments