From 5350f2882ac1cf2da66c8dc99a7fd074418021f0 Mon Sep 17 00:00:00 2001 From: dugenkui03 Date: Thu, 7 Oct 2021 12:04:04 +0800 Subject: [PATCH] add explanation about argument name uniqueness. --- spec/Section 3 -- Type System.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spec/Section 3 -- Type System.md b/spec/Section 3 -- Type System.md index d164550cc..d7b9fb704 100644 --- a/spec/Section 3 -- Type System.md +++ b/spec/Section 3 -- Type System.md @@ -873,9 +873,11 @@ of rules must be adhered to by every Object type in a GraphQL schema. characters {"__"} (two underscores). 3. The field must return a type where {IsOutputType(fieldType)} returns {true}. 4. For each argument of the field: - 1. The argument must not have a name which begins with the + 1. The argument must have a unique name within that field; + no two arguments may share the same name. + 2. The argument must not have a name which begins with the characters {"__"} (two underscores). - 2. The argument must accept a type where {IsInputType(argumentType)} + 3. The argument must accept a type where {IsInputType(argumentType)} returns {true}. 3. An object type may declare that it implements one or more unique interfaces. 4. An object type must be a super-set of all interfaces it implements: @@ -1217,9 +1219,11 @@ Interface types have the potential to be invalid if incorrectly defined. 3. The field must return a type where {IsOutputType(fieldType)} returns {true}. 4. For each argument of the field: - 1. The argument must not have a name which begins with the + 1. The argument must have a unique name within that field; + no two arguments may share the same name. + 2. The argument must not have a name which begins with the characters {"__"} (two underscores). - 2. The argument must accept a type where {IsInputType(argumentType)} + 3. The argument must accept a type where {IsInputType(argumentType)} returns {true}. 3. An interface type may declare that it implements one or more unique interfaces, but may not implement itself. @@ -1981,9 +1985,11 @@ repeatable directives. 3. The directive must not have a name which begins with the characters {"__"} (two underscores). 4. For each argument of the directive: - 1. The argument must not have a name which begins with the + 1. The argument must have a unique name within that directive; + no two arguments may share the same name. + 2. The argument must not have a name which begins with the characters {"__"} (two underscores). - 2. The argument must accept a type where {IsInputType(argumentType)} + 3. The argument must accept a type where {IsInputType(argumentType)} returns {true}. ### @skip