facebook / facebook/relay

How to publish GraphQLResponse to store?

Open
#4,410 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

We're building our own preloading mechanism, where we end up with a GraphQLResponse. Currently we're using a QueryResponseCache outside of Relay to store those query results. We do the cache lookup in the networkFetch function passed to the environment. Even though we return the materialized GraphQLResponse straight from the networkFetch function, `usePreloadedQuery` still suspends. Is there a way to properly publish a GraphQLResponse to the Relay store, so that `usePreloadedQuery` doesn't suspend?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.