# fetchMore from useSuspenseQuery is suspending even with startTransition

**URL:** <https://community.apollographql.com/t/fetchmore-from-usesuspensequery-is-suspending-even-with-starttransition/7089>\
**Category:** Client SDKs\
**Tags:** client\
**Created:** [January 2, 2024, 9:06pm UTC](https://community.apollographql.com/t/fetchmore-from-usesuspensequery-is-suspending-even-with-starttransition/7089 "2024-01-02T21:06:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronjamesking](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@aaronjamesking](https://community.apollographql.com/u/aaronjamesking)\
**Post date:** [January 2, 2024, 9:06pm UTC](https://community.apollographql.com/t/fetchmore-from-usesuspensequery-is-suspending-even-with-starttransition/7089/1 "2024-01-02T21:06:10Z")

</div>

Hi! Posting this here because it would be pretty complicated to share a minimal working example. Any advice about the details of `useSuspenseQuery` or how I could further diagnose this issue would be hugely appreciated!

In our NextJS 13 app, we use `react-infinite-scroll-component` (6.1.0) to render an infinitely scrolling list. The data for the list comes from a `useSuspenseQuery` (from `@apollo/experimental-nextjs-app-support/ssr` 0.4.3). The same component (call it `Page`) that uses the suspense query renders the `InfiniteScroll` component.

When the `InfiniteScroll` component needs more data, it calls the following function which we’ve defined:

```auto
const loadMore = () => {
  startTransition(() => {
    fetchMore({
      variables: {
        first: SCROLL_BATCH_SIZE,
        after: data?.companiesList?.pageInfo.endCursor,
        // some other variables which do not change
      },
    });
  });
};

```

This mostly works fine, meaning that the initial query suspends and renders the closest `Suspense` component (which comes from a NextJS-style `loading.tsx` file). And _most_ of the time, these calls to `fetchMore` work exactly as expected, and do not cause any suspending.

The problem is that roughly 10% of the time after `fetchMore` is called, the query suspends again for some reason, causing the `Suspense` to render. And also once the suspense is finished and the `Page` component is visible again, it seems to no longer be hydrated. That is, the infinite scrolling stops working and I’m no longer seeing React effects happen throughout `Page`.

I’m pretty sure the issue is related to this `useSuspenseQuery` because when I change it to a normal `useQuery`, the problem stops (so it isn’t something else that’s causing the suspension).

I’ve tried both `useTransition` and the `startTransition` function provided directly from the `react` library.

I’ve also observed via console logs that when this issue happens, the `fetchMore` promise resolves _after_ the `Suspense` component renders.

---

<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:** [January 2, 2024, 9:57pm UTC](https://community.apollographql.com/t/fetchmore-from-usesuspensequery-is-suspending-even-with-starttransition/7089/2 "2024-01-02T21:57:30Z")

</div>

Hey @aaronjamesking 👋

This is very interesting behavior you’re seeing! Transitions are a complicated beast! What version of `@apollo/client` are you using under the hood? Are you still seeing this with the latest versions of the core client and the NextJS wrapper package? At the time of this writing, this is v3.8.8 for the core client and 0.5.2 for the wrapper package.

---

<div class="post-metadata">

**Author:** ![aaronjamesking](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@aaronjamesking](https://community.apollographql.com/u/aaronjamesking)\
**Post date:** [January 3, 2024, 1:42am UTC](https://community.apollographql.com/t/fetchmore-from-usesuspensequery-is-suspending-even-with-starttransition/7089/3 "2024-01-03T01:42:51Z")

</div>

Hey @jerelmiller thanks for replying, I just updated the packages to 3.8.8 and 0.5.2 just to be sure, but the problem persists.  
I found [this PR](https://github.com/apollographql/apollo-client/pull/10809) but couldn’t quite tell how things are meant to work with transitions 🙂 … do you have any recommendations about how I could debug this?
