How to use useSuspenseQuery with Nextjs pages directory

Hi team, I’m super excited about apollo client 3.8 with react suspense integration. I’d like to know if there are examples of how to use useSuspenseQuery in Nextjs getServerSideProps (pages directory). I’ve seen some examples (including the new library) about how to use it with app directory but haven’t seen any examples for pages directory. Is this possible or do I have to switch to using app directory to do this?

Hey @teenoh :wave:

To my knowledge, Suspense won’t work with the pages directory via getServerSideProps because its not integrated with React 18’s streaming architecture. I believe you’ll have to switch to the app directory to take advantage of this.

@lenz can you verify this is this accurate? I’ve worked with Next.js very little and know you have a better grasp on the differences.

It will likely work in client-side rendered components, but definitely not with getServerSideProps (or at least, not any different from useQuery).
The old pages directory doesn’t support suspense on the server.