apollographql / apollo-client-nextjs

Apollo Client support for the Next.js App Router
https://www.npmjs.com/package/@apollo/experimental-nextjs-app-support
MIT License
351 stars 25 forks source link

[idea] wrap upstream package hooks with streaming functionality #215

Closed phryneas closed 2 months ago

phryneas commented 2 months ago

This, in combination with https://github.com/apollographql/apollo-client/pull/11615 would make it possible to inject functionality into the @apollo/client hooks, so it wouldn't matter if users used the @apollo/client hooks, or the hooks from this package.

That has one clear downside, though: This is a side effect that pulls all the hooks into the bundle - tree shaking of the hooks would become impossible.

It might very well be worth it, though 🤔

As an alternative, we could export set up functions for all the hooks and introduce people to execute those set up functions, which would circumvent that, but creates more friction.

phryneas commented 2 months ago

Closing in favor of #216