apollographql / apollographql/apollo-client-integrations
Batch HTTP / Other strategies for request composition
- Dominant language
- TypeScript
- Stars
- 556
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Has the guidance for how to compose queries / requests on a page evolved at all in the time this package has matured?
When the Next app router came out there was a big push to let each component be in charge of its own data, with assurances that the automatic deduping and caching of requests would ensure that it didn't matter if you fired off redundant queries.
This makes perfect sense to me in a world where your backend is all REST endpoints or hitting some kind of DB directly.
In a graph though it feels a little harder to pull off without making multiple network requests that before could have been rolled into a single graph request at the top of the page and fed down to components.
I'm trying to understand how we can achieve high composability of components that need data without firing off multiple network requests. In client components with AC we can use fragments and fire off a query at the page level that stitches all of them together, and that works. Is there an equivalent in RSCs?
As an alternative I tried using a Batch HTTP Link in my RSC client but that didn't seem to work.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the Next.js App Router and React Server Components context described in the issue, then examine how the Apollo Client RSC client handles Batch HTTP Link. Document the recommended way to compose component data without redundant network requests, including whether batching works in RSCs and what the equivalent of client-side fragments is.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, next.js, typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100