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

Demonstrate use of GraphQL Automated Persisted Queries in Contentful #13

Closed
asgorobets opened this issue Oct 9, 2023 · 1 comment
Closed
Labels

Comments

@asgorobets
Copy link
Collaborator

asgorobets commented Oct 9, 2023

Contentful released support for GraphQL APQ (Automated Persisted Queries) which allow for bigger request size and for smaller request payload for most cases over network exchange. It also enabled better caching on CDN and will be an improvement for performance.

https://www.contentful.com/developers/docs/references/graphql/#/reference/automatic-persisted-queries

We would want to have a GraphQL client that could transparently make use of this feature. APQ is supported by Apollo out of the box.
Unfortunately graphql-request is pretty basic, so we might have to move away from it to something more pluggable, or implement a custom fetcher (not sure if worth the effort):
graffle-js/graffle#269

Apollo also has a NextJS flavored client (experimental) https://github.com/apollographql/apollo-client-nextjs which if used on Server only is pretty stable, but can result in race conditions if used in mixed modes. Unrelated to task at hand, but this write-up hints to some complexity to keep in mind: apollographql/apollo-client-nextjs#132

Consider streaming, Suspense, partial-prerendering are all part of the picture, and Apollo might be too new to adopt.

@asgorobets
Copy link
Collaborator Author

Resolved by #35 by adopting urql with persistentExchange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant