From 39c785cf091d32010c045156c6335bb4f18cc320 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Thu, 1 Jul 2021 20:07:33 +0300 Subject: [PATCH] Forbid duplicating argument names Background https://github.com/graphql/graphql-wg/issues/50 graphql-js PR https://github.com/graphql/graphql-js/pull/3208 --- 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