Update doc blocks for utilities - #12831
Conversation
|
commit: |
size-limit report 📦
|
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 26 new, 66 changed, 5 removedBuild ID: deaf15bc2ef24f3b183e5954 URL: https://www.apollographql.com/docs/deploy-preview/deaf15bc2ef24f3b183e5954 |
|
!docs set-base-branch main |
|
|
||
| /** | ||
| * Adds `__typename` to all selection sets in the document. | ||
| * Adds `__typename` to all selection sets in the document. The operation |
There was a problem hiding this comment.
| * Adds `__typename` to all selection sets in the document. The operation | |
| * Adds `__typename` to all selection sets in the document. Beyond that, the operation |
The original sentence confused me a bit - is this what you mean?
| /** | ||
| * Adds `__typename` to all selection sets in the document. | ||
| * Adds `__typename` to all selection sets in the document. The operation | ||
| * definition's selection set remains unchanged. |
There was a problem hiding this comment.
| * definition's selection set remains unchanged. | |
| * Adds `__typename` to all selection sets in the document. | |
| * Returns a modified copy - the original document is not mutated. |
Or did you mean this?
There was a problem hiding this comment.
Not quite. I was trying to get at the fact we don't add __typename to the root selection set (perhaps I just use that exact phrase 🤣). Meaning:
const query = gql`
query {
__typename # this field is not added by `addTypenameToDocument`
}
`;| * `; | ||
| * | ||
| * isMutationOperation(mutation); // true | ||
| * ``` |
There was a problem hiding this comment.
| * ``` | |
| * ``` | |
| * | |
| * @remark | |
| * If you are authoring a link, you might not need to use this utility. | |
| * Use the `operationType` passed into the link as a property on the `operation` argument instead. |
Do you think it makes sense to add this remark to all three functions?
I started down the path of adding documentation for our utilities, but there are some missing component primitives that we need to add before we can do this successfully. I went ahead and added the additions suggested by claude (and refined) to the doc blocks as I felt these were worth to be kept.