Closed miii closed 1 year ago
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 https://github.com/nuxt-modules/apollo/issues/443.
JSON.stringify
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
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 https://github.com/nuxt-modules/apollo/issues/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