facebook / facebook/relay

Serializing Preloaded Queries

Open
#5,152 0 comments 6 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Hi Relay team 🤗

We're using Relay for streaming SSR with React and Tanstack Router and I wanted to check whether the guidance in the Relay examples repo is still considered the recommended approach.

In [issue-tracker-next-v13](https://github.com/relayjs/relay-examples/blob/main/issue-tracker-next-v13), the following helpers are used to ensure preloaded query references are serializable from server → client during streaming / partial hydration:

**loadSerializableQuery.ts**
https://github.com/relayjs/relay-examples/blob/main/issue-tracker-next-v13/src/relay/loadSerializableQuery.ts

**useSerializablePreloadedQuery.ts**
https://github.com/relayjs/relay-examples/blob/main/issue-tracker-next-v13/src/relay/useSerializablePreloadedQuery.ts

1. Are these helpers still the recommended / best-practice way to ensure preloaded query references are serializable when streaming?

2. With newer Relay releases and ongoing RSC / streaming support, is there a more modern or preferred pattern for handling this use case?

If so, is there documentation or an example that reflects the current recommended approach?

Thanks a lot for any clarification you can provide!

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.