Skip to content

Serializing Preloaded Queries #5152

@roduyemi

Description

@roduyemi

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, 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions