File tree Expand file tree Collapse file tree 6 files changed +31
-8
lines changed Expand file tree Collapse file tree 6 files changed +31
-8
lines changed Original file line number Diff line number Diff line change 1717 "description" : " Marks an element of a GraphQL schema as no longer supported." ,
1818 "locations" : [
1919 " FIELD_DEFINITION" ,
20- " ENUM_VALUE"
20+ " ENUM_VALUE" ,
21+ " ARGUMENT_DEFINITION"
2122 ],
2223 "name" : " deprecated"
2324 },
Original file line number Diff line number Diff line change 1717 "description" : " Marks an element of a GraphQL schema as no longer supported." ,
1818 "locations" : [
1919 " FIELD_DEFINITION" ,
20- " ENUM_VALUE"
20+ " ENUM_VALUE" ,
21+ " ARGUMENT_DEFINITION"
2122 ],
2223 "name" : " deprecated"
2324 },
Original file line number Diff line number Diff line change @@ -1701,6 +1701,23 @@ func TestEnums(t *testing.T) {
17011701 })
17021702}
17031703
1704+ type testDeprecatedArgsResolver struct {}
1705+
1706+ func (r * testDeprecatedArgsResolver ) A (args struct { B * string }) int32 {
1707+ return 0
1708+ }
1709+
1710+ func TestDeprecatedArgs (t * testing.T ) {
1711+ graphql .MustParseSchema (`
1712+ schema {
1713+ query: Query
1714+ }
1715+ type Query {
1716+ a(b: String @deprecated): Int!
1717+ }
1718+ ` , & testDeprecatedArgsResolver {})
1719+ }
1720+
17041721func TestInlineFragments (t * testing.T ) {
17051722 gqltesting .RunTests (t , []* gqltesting.Test {
17061723 {
@@ -2474,7 +2491,8 @@ func TestIntrospection(t *testing.T) {
24742491 "description": "Marks an element of a GraphQL schema as no longer supported.",
24752492 "locations": [
24762493 "FIELD_DEFINITION",
2477- "ENUM_VALUE"
2494+ "ENUM_VALUE",
2495+ "ARGUMENT_DEFINITION"
24782496 ],
24792497 "args": [
24802498 {
Original file line number Diff line number Diff line change @@ -27,9 +27,11 @@ func ParseArgumentList(l *Lexer) types.ArgumentList {
2727 name := l .ConsumeIdentWithLoc ()
2828 l .ConsumeToken (':' )
2929 value := ParseLiteral (l , false )
30+ directives := ParseDirectives (l )
3031 args = append (args , & types.Argument {
31- Name : name ,
32- Value : value ,
32+ Name : name ,
33+ Value : value ,
34+ Directives : directives ,
3335 })
3436 }
3537 l .ConsumeToken (')' )
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ var metaSrc = `
5757 # for how to access supported similar data. Formatted in
5858 # [Markdown](https://daringfireball.net/projects/markdown/).
5959 reason: String = "No longer supported"
60- ) on FIELD_DEFINITION | ENUM_VALUE
60+ ) on FIELD_DEFINITION | ENUM_VALUE | ARGUMENT_DEFINITION
6161
6262 # Provides a scalar specification URL for specifying the behavior of custom scalar types.
6363 directive @specifiedBy(
Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ package types
44//
55// https://spec.graphql.org/draft/#sec-Language.Arguments
66type Argument struct {
7- Name Ident
8- Value Value
7+ Name Ident
8+ Value Value
9+ Directives DirectiveList
910}
1011
1112// ArgumentList is a collection of GraphQL Arguments.
You can’t perform that action at this time.
0 commit comments