Commit 3951ad4 1 parent e892575 commit 3951ad4 Copy full SHA for 3951ad4
File tree 6 files changed +31
-8
lines changed
6 files changed +31
-8
lines changed Original file line number Diff line number Diff line change 17
17
"description" : " Marks an element of a GraphQL schema as no longer supported." ,
18
18
"locations" : [
19
19
" FIELD_DEFINITION" ,
20
- " ENUM_VALUE"
20
+ " ENUM_VALUE" ,
21
+ " ARGUMENT_DEFINITION"
21
22
],
22
23
"name" : " deprecated"
23
24
},
Original file line number Diff line number Diff line change 17
17
"description" : " Marks an element of a GraphQL schema as no longer supported." ,
18
18
"locations" : [
19
19
" FIELD_DEFINITION" ,
20
- " ENUM_VALUE"
20
+ " ENUM_VALUE" ,
21
+ " ARGUMENT_DEFINITION"
21
22
],
22
23
"name" : " deprecated"
23
24
},
Original file line number Diff line number Diff line change @@ -1701,6 +1701,23 @@ func TestEnums(t *testing.T) {
1701
1701
})
1702
1702
}
1703
1703
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
+
1704
1721
func TestInlineFragments (t * testing.T ) {
1705
1722
gqltesting .RunTests (t , []* gqltesting.Test {
1706
1723
{
@@ -2474,7 +2491,8 @@ func TestIntrospection(t *testing.T) {
2474
2491
"description": "Marks an element of a GraphQL schema as no longer supported.",
2475
2492
"locations": [
2476
2493
"FIELD_DEFINITION",
2477
- "ENUM_VALUE"
2494
+ "ENUM_VALUE",
2495
+ "ARGUMENT_DEFINITION"
2478
2496
],
2479
2497
"args": [
2480
2498
{
Original file line number Diff line number Diff line change @@ -27,9 +27,11 @@ func ParseArgumentList(l *Lexer) types.ArgumentList {
27
27
name := l .ConsumeIdentWithLoc ()
28
28
l .ConsumeToken (':' )
29
29
value := ParseLiteral (l , false )
30
+ directives := ParseDirectives (l )
30
31
args = append (args , & types.Argument {
31
- Name : name ,
32
- Value : value ,
32
+ Name : name ,
33
+ Value : value ,
34
+ Directives : directives ,
33
35
})
34
36
}
35
37
l .ConsumeToken (')' )
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ var metaSrc = `
57
57
# for how to access supported similar data. Formatted in
58
58
# [Markdown](https://daringfireball.net/projects/markdown/).
59
59
reason: String = "No longer supported"
60
- ) on FIELD_DEFINITION | ENUM_VALUE
60
+ ) on FIELD_DEFINITION | ENUM_VALUE | ARGUMENT_DEFINITION
61
61
62
62
# Provides a scalar specification URL for specifying the behavior of custom scalar types.
63
63
directive @specifiedBy(
Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ package types
4
4
//
5
5
// https://spec.graphql.org/draft/#sec-Language.Arguments
6
6
type Argument struct {
7
- Name Ident
8
- Value Value
7
+ Name Ident
8
+ Value Value
9
+ Directives DirectiveList
9
10
}
10
11
11
12
// ArgumentList is a collection of GraphQL Arguments.
You can’t perform that action at this time.
0 commit comments