Export PreloadQueryRef#549
Conversation
|
@teodorszeltins: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
🦋 Changeset detectedLatest commit: 04017bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👷 Deploy request for apollo-client-nextjs-docmodel pending review.Visit the deploys page to approve it
|
|
@teodorszeltins is attempting to deploy a commit to the Apollo Client - Next package - integration tests Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
📜 Recent review details🧰 Additional context used🧠 Learnings (5)📚 Learning: 2026-04-08T16:23:43.800ZApplied to files:
📚 Learning: 2026-04-08T16:23:43.800ZApplied to files:
📚 Learning: 2026-04-08T16:23:43.800ZApplied to files:
📚 Learning: 2026-04-08T16:23:43.800ZApplied to files:
📚 Learning: 2026-04-08T16:23:43.800ZApplied to files:
🔇 Additional comments (13)
📝 WalkthroughWalkthroughThis update renames the internal Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This exports
PreloadQueryRefas a public API and adds it to the object returned byregisterApolloClient.Until now, it only existed as an internal helper used by
PreloadQueryunder the nameSimulatePreloadedQuery.Why
PreloadQuerystarts the query from where it appears in the render tree, so the request does not begin until React gets there.This makes it harder to parallelise GraphQL queries with other async work (REST calls, auth checks, etc.) at the top of a Server Component.
PreloadQueryRefmakes that flow a bit more flexible. You can create thequeryRefearly withcreateTransportedQueryPreloader, start the query right away, and render<PreloadQueryRef>later to hydrate it into the client tree.Usage
Summary by CodeRabbit
Release Notes
PreloadQueryRefas a public API, now available throughregisterApolloClient, enabling query-ref-first preloading workflows for improved data fetching patterns.