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

Add a PoC implementation of the new GraphQL defer directive on the SFAPI #1797

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blittle
Copy link
Contributor

@blittle blittle commented Feb 28, 2024

This is a proof of concept implementation of the new GraphQL defer directive on the SFAPI.

A few notes:

  1. It requires the defer directive developer preview: https://shopify.dev/docs/api/release-notes/developer-previews#defer-directive-developer-preview
  2. It uses the @shopify/storefront-api-client package, because hydrogen's built in api client does not yet support defer/streaming.
  3. At runtime, it parses the GraphQL query, finds the defer directives, and replaces the associated fragment properties with inline promises that resolve after the data is available.
  4. It only supports top level deferred properties. Not nested.

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