-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Editorial: Clarify type modifiers text #845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,10 +227,10 @@ enum __DirectiveLocation { | |
|
||
`__Type` is at the core of the type introspection system, it represents all | ||
types in the system: both named types (e.g. Scalars and Object types) and | ||
type modifiers (e.g. List and Non-Null types). | ||
wrapped types (e.g. List and Non-Null types). | ||
|
||
Type modifiers are used to modify the type presented in the field `ofType`. | ||
This modified type may recursively be a modified type, representing lists, | ||
Wrapped types modify the type presented in the field `ofType` (the "inner | ||
type"). The inner type may recursively be a wrapped type, representing lists, | ||
non-nullables, and combinations thereof, ultimately modifying a named type. | ||
|
||
### Type Kinds | ||
|
@@ -352,11 +352,11 @@ Fields | |
|
||
#### List | ||
|
||
Lists represent sequences of values in GraphQL. A List type is a type modifier: | ||
Lists represent sequences of values in GraphQL. A List type is a wrapped type: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this phrasing is ambiguous/confusing. A list type is a "wrapping type" but an instance of a list type is a "wrapped type". Within introspection we only see instances, so this usage is probably right, but this phrasing relative to "A List type" makes this distinction a bit less clear IMO. What do you think about:
This replaces "A List type is a wrapped type" with "A List wrapped type" - using your definition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scratch this feedback. I'm working on a broader change based on yours that applies this new terminology broadly and I think I can resolve this at the definition of "List type" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This reads a lot better 👍
Okay 👍 |
||
it wraps another type instance in the `ofType` field, which defines the type of | ||
each item in the list. | ||
|
||
The modified type in the `ofType` field may itself be a modified type, allowing | ||
The type presented in the `ofType` field may itself be a wrapped type, allowing | ||
the representation of Lists of Lists, or Lists of Non-Nulls. | ||
|
||
Fields | ||
|
@@ -370,13 +370,13 @@ Fields | |
|
||
GraphQL types are nullable. The value {null} is a valid response for field type. | ||
|
||
A Non-Null type is a type modifier: it wraps another type instance in the | ||
A Non-Null type is a wrapped type: it wraps another type instance in the | ||
`ofType` field. Non-null types do not allow {null} as a response, and indicate | ||
required inputs for arguments and input object fields. | ||
|
||
The modified type in the `ofType` field may itself be a modified List type, | ||
The type presented in the `ofType` field may itself be a List wrapped type, | ||
allowing the representation of Non-Null of Lists. However it must not be a | ||
modified Non-Null type to avoid a redundant Non-Null of Non-Null. | ||
Non-Null wrapped type to avoid a redundant Non-Null of Non-Null. | ||
|
||
* `kind` must return `__TypeKind.NON_NULL`. | ||
* `ofType`: Any type except Non-Null. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we either need to rephrase this or change this term to "Wrapping types" since a "wrapped type" is modified while a "wrapping type" is modifying.
So either:
Or:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of these, the latter seems clearer to me.