-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Update doc blocks for utilities #12831
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 11 commits
d0ce36f
35c55d9
98446e2
8d21e28
6267ced
109ab2d
e7e1c70
ecac114
b25ca1c
c53edf0
4b311a5
650a16e
97af276
4d95f08
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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,9 +10,20 @@ const TYPENAME_FIELD: FieldNode = { | |||||||
| }; | ||||||||
|
|
||||||||
| /** | ||||||||
| * Adds `__typename` to all selection sets in the document. | ||||||||
| * Adds `__typename` to all selection sets in the document. The operation | ||||||||
|
Member
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.
Suggested change
The original sentence confused me a bit - is this what you mean? |
||||||||
| * definition's selection set remains unchanged. | ||||||||
|
Member
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.
Suggested change
Or did you mean this?
Member
Author
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. Not quite. I was trying to get at the fact we don't add const query = gql`
query {
__typename # this field is not added by `addTypenameToDocument`
}
`;
Member
Author
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. Went with this instead: 650a16e |
||||||||
| * | ||||||||
| * @param doc - The `ASTNode` to add `__typename` to | ||||||||
| * | ||||||||
| * @example | ||||||||
| * | ||||||||
| * ```ts | ||||||||
| * const document = gql` | ||||||||
| * # ... | ||||||||
| * `; | ||||||||
| * | ||||||||
| * const withTypename = addTypenameToDocument(document); | ||||||||
| * ``` | ||||||||
| */ | ||||||||
| export const addTypenameToDocument = Object.assign( | ||||||||
| function <TNode extends ASTNode>(doc: TNode): TNode { | ||||||||
|
|
||||||||
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.
Do you think it makes sense to add this remark to all three functions?
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 like it. Added in 97af276