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

Entity cache: query hashing should take requires and provides into account #4834

Closed
Geal opened this issue Mar 22, 2024 · 0 comments · Fixed by #4883
Closed

Entity cache: query hashing should take requires and provides into account #4834

Geal opened this issue Mar 22, 2024 · 0 comments · Fixed by #4883
Assignees

Comments

@Geal
Copy link
Contributor

Geal commented Mar 22, 2024

This method of hashing considers directives, but only their presence and arguments. If we want to extend it outside of subgraph queries, it needs to consider how some arguments work, like @requires, because it may introduce more fields in the query, and those fields could have changed

@Geal Geal self-assigned this Apr 2, 2024
@Geal Geal closed this as completed in #4883 Apr 4, 2024
Geal added a commit that referenced this issue Apr 4, 2024
Fix #4834

This extends the schema aware hashing already employed for subgraph queries
in entity caching, to be calculated for client queries, and look at that hash in
the query planner cache to be able to reuse cached entries across schema
reloads.
This contains:
- an update of the traverse visitor to use an `ExecutableDocument`
(necessary to parse field sets in `key` and `requires` argument
- parses field sets in `@join__type`'s `key` argument and
`@join__field`'s `requires` argument, because they can be affected by
schema updates
- remove the hack around `_entities` operation
- parse subgraph queries using the subgraph schemas extracted from the
supergraph schema
- update query planner cache warm up to check if the query hash changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant