Skip to content
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

Clarify that id is optional on queries in cache.modify documentation #9894

Merged
merged 2 commits into from
Jul 12, 2022

Conversation

MrDoomBringer
Copy link
Contributor

Closes #7862
From the above issue:

Omitting the id is like calling cache.modify({ id: "ROOT_QUERY", fields }), since ROOT_QUERY happens to be the hard-coded ID of the root query singleton object.

ID isn't a required parameter for cache.modify, this updates the documentation to reflect that.

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

Copy link
Contributor

@StephenBarlow StephenBarlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MrDoomBringer! I've left some suggestions, let me know if anything looks out of sorts

docs/source/api/cache/InMemoryCache.mdx Outdated Show resolved Hide resolved
docs/source/api/cache/InMemoryCache.mdx Outdated Show resolved Hide resolved
docs/source/api/cache/InMemoryCache.mdx Outdated Show resolved Hide resolved
docs/source/api/cache/InMemoryCache.mdx Outdated Show resolved Hide resolved
docs/source/api/cache/InMemoryCache.mdx Outdated Show resolved Hide resolved
MrDoomBringer and others added 2 commits July 12, 2022 10:33
ID is only required if you're modifying a specific object, but can be omitted if you're modifying a query. This updates the documentation to reflect this
Co-authored-by: Stephen Barlow <stephen@apollographql.com>
@StephenBarlow StephenBarlow merged commit 90c604f into main Jul 12, 2022
@StephenBarlow StephenBarlow deleted the issue-7862 branch July 12, 2022 18:45
@MrDoomBringer MrDoomBringer self-assigned this Sep 12, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs inconsistency for cache.modify
2 participants