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

fix: improve tracking of query analyzer list types #2834

Merged
merged 2 commits into from Jun 26, 2023

Conversation

jasonbahl
Copy link
Collaborator

What does this implement/fix? Explain your changes.

This modifies the QueryAnalyzer to only track list:$type_name for RootConnections.

Nested connections will not tag the query with list:$type_name as it was leading to over-purging.

see: wp-graphql/wp-graphql-smart-cache#225

Does this close any currently open issues?

related: wp-graphql/wp-graphql-smart-cache#225

Any other comments?

This should significantly reduce the amount of queries that are purged from common events such as publishing posts.

Before

Here we can see that a query for a Category and it's related posts will return a list:post key, meaning it will invalidate anytime a new post is published.

CleanShot 2023-06-23 at 13 12 00

After

Here we do not see the list:post key, meaning that this query will not invalidate whenever a new post is published.

However, if a new post is published and associated with the "child" category, then this query will be purged because that will call purge on the ID of the child category.

CleanShot 2023-06-23 at 13 11 38

@codeclimate
Copy link

codeclimate bot commented Jun 23, 2023

Analysis results are not available for those commits

View more on Code Climate.

@jasonbahl jasonbahl changed the title Fix/query analyzer list types fix: improve tracking of query analyzer list types Jun 23, 2023
@jasonbahl
Copy link
Collaborator Author

NOTE: The Schema Linter is failing because the 1.14.4 release failed to upload the schema because the mariadb version in the workflow was having issues. The workflow has now been pinned and the next release should fix it.

@jasonbahl jasonbahl merged commit 9a4d12a into wp-graphql:develop Jun 26, 2023
26 of 27 checks passed
@jasonbahl jasonbahl mentioned this pull request Jun 26, 2023
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 this pull request may close these issues.

None yet

1 participant