From 5c27ccb8c7e17c9314396b5c2ecf0f7b39ef01e2 Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Tue, 7 Jul 2015 14:01:55 -0700 Subject: [PATCH] Add Names sub-section to Language Address common questions around named things in GraphQL. case-sensitivity, ASCII subset, underscores. Fixes #33 --- Section 2 -- Language.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Section 2 -- Language.md b/Section 2 -- Language.md index 7724a3779..11a7b7662 100644 --- a/Section 2 -- Language.md +++ b/Section 2 -- Language.md @@ -5,6 +5,21 @@ refer to these requests as documents. A document may contain operations (queries and mutations are both operations) and fragments, a common unit of composition allowing for query reuse. +## Names + +GraphQL documents are full of named things: operations, fields, arguments, +directives, fragments, and variables. All names follow the same +grammatical form: + +Name : /[_A-Za-z][_0-9A-Za-z]*/ + +Names in GraphQL are case-sensitive. That is to say `name`, `Name`, and `NAME` +all refer to different names. Underscores are significant, which means +`other_name` and `othername` are two different names. + +Names in GraphQL are limited to this ASCII subset of possible +characters to support interoperation with as many other systems as possible. + ## Document GraphQL documents are only executable by a server if they contain an operation.