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: support function expressions in config #537

Merged

Conversation

miii
Copy link
Contributor

@miii miii commented Aug 10, 2023

This PR adds support for use of function expressions inside Apollo config, e.g. to define custom type policies.
https://www.apollographql.com/docs/react/caching/cache-field-behavior

The current serializer, JSON.stringify, simply removes all function expressions as it cannot serialize them.
This is also mentioned in #443.

A common use case for this is offset-limit paginated queries where new entries may be merged with previously fetched results (instead of treating them as different queries).
https://www.apollographql.com/docs/react/pagination/offset-based#the-offsetlimitpagination-helper

@netlify
Copy link

netlify bot commented Aug 10, 2023

Deploy Preview for apollo-module canceled.

Name Link
🔨 Latest commit 860d6ff
🔍 Latest deploy log https://app.netlify.com/sites/apollo-module/deploys/64d5041b11074200087a150b

@Diizzayy Diizzayy merged commit 1d6e1f7 into nuxt-modules:v5 Nov 23, 2023
5 checks passed
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

2 participants