Skip to content

Commit 12b7ad7

Browse files
dugenkui03benjie
andauthoredFeb 2, 2023
add explanation about argument name uniqueness. (#891)
Co-authored-by: Benjie Gillam <[email protected]>
1 parent 45ffddb commit 12b7ad7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎spec/Section 3 -- Type System.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,11 @@ of rules must be adhered to by every Object type in a GraphQL schema.
878878
4. For each argument of the field:
879879
1. The argument must not have a name which begins with the characters
880880
{"\_\_"} (two underscores).
881-
2. The argument must accept a type where {IsInputType(argumentType)}
881+
2. The argument must have a unique name within that field; no two
882+
arguments may share the same name.
883+
3. The argument must accept a type where {IsInputType(argumentType)}
882884
returns {true}.
883-
3. If argument type is Non-Null and a default value is not defined:
885+
4. If argument type is Non-Null and a default value is not defined:
884886
- The `@deprecated` directive must not be applied to this argument.
885887
3. An object type may declare that it implements one or more unique interfaces.
886888
4. An object type must be a super-set of all interfaces it implements:
@@ -1228,7 +1230,9 @@ Interface types have the potential to be invalid if incorrectly defined.
12281230
4. For each argument of the field:
12291231
1. The argument must not have a name which begins with the characters
12301232
{"\_\_"} (two underscores).
1231-
2. The argument must accept a type where {IsInputType(argumentType)}
1233+
2. The argument must have a unique name within that field; no two
1234+
arguments may share the same name.
1235+
3. The argument must accept a type where {IsInputType(argumentType)}
12321236
returns {true}.
12331237
3. An interface type may declare that it implements one or more unique
12341238
interfaces, but may not implement itself.
@@ -2004,7 +2008,9 @@ repeatable directives.
20042008
4. For each argument of the directive:
20052009
1. The argument must not have a name which begins with the characters
20062010
{"\_\_"} (two underscores).
2007-
2. The argument must accept a type where {IsInputType(argumentType)} returns
2011+
2. The argument must have a unique name within that directive; no two
2012+
arguments may share the same name.
2013+
3. The argument must accept a type where {IsInputType(argumentType)} returns
20082014
{true}.
20092015

20102016
### @skip

0 commit comments

Comments
 (0)
Please sign in to comment.