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

feat(graphql): allow to pass cache hints to graphql fields #20254

Closed

Conversation

iamandrewluca
Copy link
Contributor

@iamandrewluca iamandrewluca commented May 2, 2024

What does it do?

2024-05-03.03-24-48.mp4

Why is it needed?

https://www.apollographql.com/docs/apollo-server/performance/caching/

Note: Strapi uses a previous major version of Apollo Server, which works similarly.

How to test it?

Provide information about the environment and the path to verify the behaviour.

To Do

  • Allow to add cache hints to type fields
  • Allow to add cache hints to top-level Queries
  • Upgrade to nexus@next and use directive as static instead of resolve
  • Check Authenticated/Public roles cache Authenticated should be private
  • Test if the cache works fine for all field types

Copy link

vercel bot commented May 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ❌ Failed (Inspect) May 3, 2024 2:32am

@@ -12,7 +12,6 @@ const dtoFields = [
'options',
'pluginOptions',
'attributes',
'pluginOptions',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: Removed duplicated value.

Comment on lines 101 to 106
graphql?: {
cacheHint?: {
find?: CacheHint;
findOne?: CacheHint;
}
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Question: Why is this field type not visible in find/findOne resolvers? 🤔

@iamandrewluca
Copy link
Contributor Author

I will close this experiment PR for now. Might come to it at a later time or in v5.

@iamandrewluca iamandrewluca deleted the feat/graphql-cache-control branch May 14, 2024 16:38
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