# How to use useSuspenseQuery with Nextjs pages directory

**URL:** <https://community.apollographql.com/t/how-to-use-usesuspensequery-with-nextjs-pages-directory/6665>\
**Category:** Client SDKs\
**Tags:** client\
**Created:** [August 30, 2023, 11:25pm UTC](https://community.apollographql.com/t/how-to-use-usesuspensequery-with-nextjs-pages-directory/6665 "2023-08-30T23:25:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![teenoh](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/teenoh/32/4550_2.png) [@teenoh](https://community.apollographql.com/u/teenoh)\
**Post date:** [August 30, 2023, 11:25pm UTC](https://community.apollographql.com/t/how-to-use-usesuspensequery-with-nextjs-pages-directory/6665/1 "2023-08-30T23:25:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jerelmiller](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/jerelmiller/32/3314_2.png) [@jerelmiller](https://community.apollographql.com/u/jerelmiller)\
**Post date:** [August 30, 2023, 11:40pm UTC](https://community.apollographql.com/t/how-to-use-usesuspensequery-with-nextjs-pages-directory/6665/2 "2023-08-30T23:40:42Z")

</div>

Hey @teenoh 👋

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.

---

<div class="post-metadata">

**Author:** ![lenz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lenz/32/4007_2.png) [@lenz](https://community.apollographql.com/u/lenz)\
**Post date:** [August 31, 2023, 8:40am UTC](https://community.apollographql.com/t/how-to-use-usesuspensequery-with-nextjs-pages-directory/6665/3 "2023-08-31T08:40:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/how-to-use-usesuspensequery-with-nextjs-pages-directory/6665/4 "2025-02-06T20:48:22Z")

</div>


