Replies: 1 comment 2 replies
-
Following up from the working group call today, thank you for the careful read through of the spec and capturing all of these improvements. The best way to track and address these kinds of issues are with spec PRs. These are all Editorial changes, which we typically review without the need for a live working group discussion. The non-controversial changes we'll directly merge, and any that warrant discussion we can have that within the context of a focused PR. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all
I've been finding small things in the spec, typos or small mistakes, for a while now. Tried to write them down to report later, but kept losing them. Finally, decided to spend some time, go thru the spec line-by-line and get these little annoying things into one list. Below is the result. The issues are in the order as they appear in the spec. Some are obvious typos, others may require some discussions.
I assigned each item an ID like P1, P2 etc, for easier references. We should probably first discuss how to better handle the list (track it), maybe some spreadsheet or smth. Feedback, comments are welcome.
thank you
P1
Section "2 Language"
https://spec.graphql.org/October2021/#sec-Language
Wiki: "... lexing or tokenization is the process of converting a sequence of characters... into a sequence of tokens ...".
Link: https://en.wikipedia.org/wiki/Lexical_analysis
In general the sentence does not make much sense. Better version: The structure of a GraphQL document is defined by a syntactic grammar and lexical definitions (terminal symbols).
P2
Section 2.1.3 Line Terminators
https://spec.graphql.org/October2021/#sec-Line-Terminators
Not true, block string can contain line terminators
P3
Section 2.5 Fields
https://spec.graphql.org/October2021/#sec-Language.Fields
Should be 'scalar or enum values, or lists of those types'; technically enums are not scalars. We can introduce 'primitive' types = scalars + enums, and lists of these.
P4
Section 2.8.2 Inline Fragments
https://spec.graphql.org/October2021/#sec-Inline-Fragments
should be: ... based on parent object's runtime type.
P5
Section 2.10 Variables
https://spec.graphql.org/October2021/#sec-Language.Variables
Well, sounds like a typical cry-baby client dev - oh, building strings is so hard! Hard?! Try parsing them!
Now seriously. We should point to the real win - reusing parsed queries on the server side: "... maximizing reuse of parsed queries by the GraphQL service."
P6
Section 3. Type system
Sub-section 3.3.1 Root Operation Types,
sub-section Default Root Operation Type Names
https://spec.graphql.org/October2021/#sec-Root-Operation-Types.Default-Root-Operation-Type-Names
P7
Section 3.6 Objects, sub-section Result Coersion,
https://spec.graphql.org/October2021/#sec-Objects.Result-Coercion
P8
Section 3.12.1 Combining List and Non-Null
http://spec.graphql.org/October2021/#sec-Combining-List-and-Non-Null
There is no such section or subsection. There is section "Errors and Non-Null Fields"
http://spec.graphql.org/October2021/#sec-Executing-Selection-Sets.Errors-and-Non-Null-Fields
P9
Section 4 Introspection, sub-section Introspection/Reserved Names
https://spec.graphql.org/October2021/#sec-Introspection.Reserved-Names
talks about reserved "__" prefix, but not particular reserved names. Spec reserves a prefix, not names. Section better be titled "Name restrictions" and should be moved to 'type system'. There is also "Reserved Names" subsection in chapter 2: https://spec.graphql.org/October2021/#sec-Names.Reserved-Names - probably should be renamed too.
By the way, we do have reserved words: 'on', 'true', 'false', may be some others; they are explicitly mentioned in Grammar as lookahead restrictions or non-names. We just need to explicitly declare these as Reserved Names(words) - those names that cannot be used for custom identifiers. It is a common practice in programming languages.
P10
Section 4.2.2 The _Type Type, sub-section Introspection/Interfaces
https://spec.graphql.org/October2021/#sec-The-__Type-Type.Interface
should be "that an INTERFACE implements"
P11
Section 5 Validation
https://spec.graphql.org/October2021/#sec-Validation
GraphQL-who? Who verifies? GraphQL? is it a person? Or code?
one of these cases when spec suggests that server devs are stupid, and don't know about caching techniques. We should remove this statement. Server devs do not need permission from spec to do optimization tricks like caching if they do not change the outcome (the visible functionality of the service)
P12
Section Subscriptions/Delivery Agnostic
https://spec.graphql.org/October2021/#sec-Subscription.Delivery-Agnostic
Typo: should be 'specify' (for plural form)
Specifies algorithms? - maybe specifies parameters/settings/env, but not algorithms?
P13
Section 5.3.2 Field Selection Merging
right after this example: https://spec.graphql.org/October2021/#example-a2230
comment: not sure what it means; maybe 'identical FIELDS are also merged...'?
(same section)
in the context of the example, probably it should be "scalar types must not differ"
P14
Section 5.3.3 Leaf Field Selections
Subsection Formal Specification
https://spec.graphql.org/October2021/#sec-Leaf-Field-Selections.Formal-Specification
In both cases, array type of these types must be included. Also, there's a semicolon after first condition, but not after the second one (after ', or object'). The same (about arrays) applies to text below in Explanatory Text:
P15
Section 6 Execution
https://spec.graphql.org/October2021/#sec-Execution
Should be GraphQL service.
P16
Section 6.2.2
https://spec.graphql.org/October2021/#sec-Mutation
'ensures against race conditions' - no it does not; what about concurrent requests from other clients?! Server holds data for and serves it to many clients, concurrently; in many cases data is shared between clients. This statement is just silly, should be removed.
P17
Section 6.2.2.3 Unsubscribe
https://spec.graphql.org/October2021/#sec-Unsubscribe
(read the section)
what exactly it specifies? the exact method/format/request of cancelling the stream? Is it another field/method in Subscription or Mutation object? what kind of call cancels subscription? Or it is canceled by just disconnecting of long-lived connection (socket or smth)
P18
Section 6.2.3 Subscription
Note inlet http://spec.graphql.org/October2021/#note-79d56
Should be 'In large-scale subscription', with hyphen: https://grammarhow.com/large-scale-or-large-scale/
P19
Subsection Supporting Subscriptions at Scale
http://spec.graphql.org/October2021/#sec-Subscription.Supporting-Subscriptions-at-Scale
should it be 'significant challenge'?
P20
Subsection Delivery Agnostic
http://spec.graphql.org/October2021/#sec-Subscription.Delivery-Agnostic
typo: should be 'specify'
P21
Section 6.3 Executing Selection Sets
Algorithm ExecuteSelectionSet
http://spec.graphql.org/October2021/#ExecuteSelectionSet()
How is it possible that fieldType is not defined?! and what happens if it's not?
P22
Section 6.3.1 Normal and Serial execution
https://spec.graphql.org/October2021/#sec-Normal-and-Serial-Execution
https://en.wikipedia.org/wiki/Side_effect_(computer_science)#Referential_transparency (at the end of paragraph)
https://www.sciencedirect.com/science/article/abs/pii/0096055195000089
idempotent: "... can be applied multiple times without changing the result beyond the initial application." (wikipedia).
P23
Examples 191, 192
http://spec.graphql.org/October2021/#example-33b6a
http://spec.graphql.org/October2021/#example-c91a3
These two are examples of mutations. They should not use a shorthand format (without operation type and name) - it is allowed only for queries; they should explicitly use 'mutation' keyword.
P24
Section 6.4.3 Value Completion
Subsection Merging Selection Sets
http://spec.graphql.org/October2021/#sec-Value-Completion.Merging-Selection-Sets
P25
Section 7.1.1 Data
http://spec.graphql.org/October2021/#sec-Data
The first paragraph describes the response object for query, mutation. Should also mention Subscription for completeness.
P26
Section 7.1.2 Errors
http://spec.graphql.org/October2021/#sec-Errors
The last sentence appears to be a repeat (in meaning) of the previous one.
P27
Subsection Request errors
http://spec.graphql.org/October2021/#sec-Errors.Request-errors
should be 'in the request document'
P28
Consistency in capitalization of titles of non-numbered subsections
In chapter 7 "Response", all subsection titles without numbers are capitalized with Sentence style, for ex: 'Request errors'.
In chapter 6 "Execution", subsection titles without numbers are capitalized in First-cap style, for ex: 'Event Streams'
P29
General observation, multiple times throughout the spec
Throughout the doc 'GraphQL' is used as an 'actor' - GraphQL validates, GraphQL executes, etc. As if it can act, as a person or software actor. But it is an abstract thing, it cannot do stuff. For real actions, we should be more explicit: GraphQL Service does this or that.
Examples of current use:
Validation: GraphQL does not just verify if a request is syntactically correct,
Execution: GraphQL generates a response from a request via execution.
Beta Was this translation helpful? Give feedback.
All reactions