@@ -98,8 +98,8 @@ LineTerminator ::
98
98
- "Carriage Return (U+000D)" "New Line (U+000A)"
99
99
100
100
Like white space, line terminators are used to improve the legibility of source
101
- text and separate lexical tokens, any amount may appear before or after any
102
- other token and have no significance to the semantic meaning of a GraphQL
101
+ text and separate lexical tokens, any amount may appear before or after any
102
+ other token and have no significance to the semantic meaning of a GraphQL
103
103
Document. Line terminators are not found within any other token.
104
104
105
105
Note: Any error reporting which provides the line number in the source of the
@@ -151,7 +151,7 @@ Token ::
151
151
- StringValue
152
152
153
153
A GraphQL document is comprised of several kinds of indivisible lexical tokens
154
- defined here in a lexical grammar by patterns of source Unicode characters.
154
+ defined here in a lexical grammar by patterns of source Unicode characters.
155
155
Lexical tokens may be separated by {Ignored} tokens.
156
156
157
157
Tokens are later used as terminal symbols in GraphQL syntactic grammar rules.
@@ -251,9 +251,10 @@ However documents which do not contain {OperationDefinition} or do contain
251
251
and validated to allow client tools to represent many GraphQL uses which may
252
252
appear across many individual files.
253
253
254
- If a Document contains only one operation, that operation may be unnamed or
255
- represented in the shorthand form, which omits both the query keyword and
256
- operation name. Otherwise, if a GraphQL Document contains multiple
254
+ If a Document contains only one operation, that operation may be unnamed. If
255
+ that operation is a query without variables or directives then it may also be
256
+ represented in the shorthand form, omitting both the {` query ` } keyword as well
257
+ as the operation name. Otherwise, if a GraphQL Document contains multiple
257
258
operations, each operation must be named. When submitting a Document with
258
259
multiple operations to a GraphQL service, the name of the desired operation to
259
260
be executed must also be provided.
@@ -295,9 +296,10 @@ mutation {
295
296
296
297
** Query shorthand**
297
298
298
- If a document contains only one query operation, and that query defines no
299
- variables and contains no directives, that operation may be represented in a
300
- short-hand form which omits the query keyword and query name.
299
+ If a document contains only one operation and that operation is a query which
300
+ defines no variables and contains no directives then that operation may be
301
+ represented in a short-hand form which omits the {` query ` } keyword and operation
302
+ name.
301
303
302
304
For example, this unnamed query operation is written via query shorthand.
303
305
0 commit comments