# Client SDKs

**URL:** https://community.apollographql.com/c/client-sdk/21.md?page=1

[Latest](https://community.apollographql.com/latest.md) · [Categories](https://community.apollographql.com/categories.md) · [Tags](https://community.apollographql.com/tags.md)

**Page:** 2

---

## [useMutation hook usage in apollo v4](https://community.apollographql.com/t/usemutation-hook-usage-in-apollo-v4/9532)

<div class="topic-metadata">

**Author:** [@raxell](https://community.apollographql.com/u/raxell)\
**Replies:** 4\
**Last updated:** [November 3, 2025, 8:35am UTC](https://community.apollographql.com/t/usemutation-hook-usage-in-apollo-v4/9532 "2025-11-03T08:35:50Z")

</div>

Hi, regarding the migration to apollo client v4, the migration guide says As a result, we now recommend the use of core APIs directly in several use cases where synchronization with a component is not needed or intende…

---

## [Apollo v4 updateQuery](https://community.apollographql.com/t/apollo-v4-updatequery/9534)

<div class="topic-metadata">

**Author:** [@raxell](https://community.apollographql.com/u/raxell)\
**Replies:** 3\
**Last updated:** [October 30, 2025, 12:17pm UTC](https://community.apollographql.com/t/apollo-v4-updatequery/9534 "2025-10-30T12:17:23Z")

</div>

Hi, new question about the migration to v4 (react). I have some places when i use updateQuery, e.g. updateQuery((state) =\> ({ ...state, myField: \[ ...state.myField, {…

---

## [Best Practice for Handling Build Type-Specific Schema Endpoints in Android Multi-Module Setup](https://community.apollographql.com/t/best-practice-for-handling-build-type-specific-schema-endpoints-in-android-multi-module-setup/9524)

<div class="topic-metadata">

**Author:** [@Lana\_Mozharovska](https://community.apollographql.com/u/Lana_Mozharovska)\
**Replies:** 0\
**Last updated:** [October 23, 2025, 7:16am UTC](https://community.apollographql.com/t/best-practice-for-handling-build-type-specific-schema-endpoints-in-android-multi-module-setup/9524 "2025-10-23T07:16:25Z")

</div>

Hi Apollo Community, I’m working on a multi-module Android project and trying to figure out the best way to handle schema downloads based on our app’s build types. Our Setup: :app module: Defines buildTypes (debug, s…

---

## [Caching and error handling](https://community.apollographql.com/t/caching-and-error-handling/9493)

<div class="topic-metadata">

**Author:** [@persilja](https://community.apollographql.com/u/persilja)\
**Replies:** 0\
**Last updated:** [October 9, 2025, 9:25am UTC](https://community.apollographql.com/t/caching-and-error-handling/9493 "2025-10-09T09:25:59Z")

</div>

Hi! I was wondering how to make the cache NOT write when there is an error in the graph ql response. Error Handling - Apollo GraphQL Docs The reason to not write responses that contains errors are the it could overwrit…

---

## [Is @stream field directive supported in v2?](https://community.apollographql.com/t/is-stream-field-directive-supported-in-v2/9491)

<div class="topic-metadata">

**Author:** [@Pat](https://community.apollographql.com/u/Pat)\
**Replies:** 0\
**Last updated:** [October 8, 2025, 5:29pm UTC](https://community.apollographql.com/t/is-stream-field-directive-supported-in-v2/9491 "2025-10-08T17:29:33Z")

</div>

The docs and a previously filed issue appear to indicate that @defer is supported, but it’s not clear if @stream is as well? Is that something that can be properly documented, as well as what other directives are (or are…

---

## [Use cached pagination data if query has already been requested before?](https://community.apollographql.com/t/use-cached-pagination-data-if-query-has-already-been-requested-before/9470)

<div class="topic-metadata">

**Author:** [@SimplySnide](https://community.apollographql.com/u/SimplySnide)\
**Replies:** 2\
**Last updated:** [October 8, 2025, 3:42pm UTC](https://community.apollographql.com/t/use-cached-pagination-data-if-query-has-already-been-requested-before/9470 "2025-10-08T15:42:56Z")

</div>

I’m using using Apollos useQuery hook in react to make a paginated request to my graphql server. The component provides set filters that can be toggled by the user and simply will add the value to the variables property. …

---

## [What's the actual recommendation regarding graphql-codegen?](https://community.apollographql.com/t/whats-the-actual-recommendation-regarding-graphql-codegen/9481)

<div class="topic-metadata">

**Author:** [@tyteen4a03](https://community.apollographql.com/u/tyteen4a03)\
**Replies:** 1\
**Last updated:** [October 6, 2025, 8:10am UTC](https://community.apollographql.com/t/whats-the-actual-recommendation-regarding-graphql-codegen/9481 "2025-10-06T08:10:29Z")

</div>

I was trying to debug issues around codegen not showing, and noticed that Apollo actually has conflicting advice regarding the use of @graphql-codegen/client-preset. The official tutorial suggests using it, but the offi…

---

## [SSR has 100% miss on AST print cache](https://community.apollographql.com/t/ssr-has-100-miss-on-ast-print-cache/9475)

<div class="topic-metadata">

**Author:** [@joeyciechanowicz](https://community.apollographql.com/u/joeyciechanowicz)\
**Replies:** 0\
**Last updated:** [October 2, 2025, 10:34am UTC](https://community.apollographql.com/t/ssr-has-100-miss-on-ast-print-cache/9475 "2025-10-02T10:34:27Z")

</div>

When server-side rendering I’ve noticed that a lot of memory allocation and CPU time is spent printing the query AST. The printer does have a cache, but you get a 100% cache miss rate as the query gets transformed by th…

---

## [Apollo iOS 2.0 is here!](https://community.apollographql.com/t/apollo-ios-2-0-is-here/9473)

<div class="topic-metadata">

**Author:** [@AnthonyMDev](https://community.apollographql.com/u/AnthonyMDev)\
**Replies:** 0\
**Last updated:** [October 1, 2025, 9:00pm UTC](https://community.apollographql.com/t/apollo-ios-2-0-is-here/9473 "2025-10-01T21:00:52Z")

</div>

Apollo iOS 2.0 is now available! :tada: Apollo iOS 2.0 represents a complete reimplementation of many components of the library, redesigned from the ground up to take full advantage of Swift’s modern concurrency model. T…

---

## [What's the proper way to write subscribeToMore.updateQuery in Typescript?](https://community.apollographql.com/t/whats-the-proper-way-to-write-subscribetomore-updatequery-in-typescript/9455)

<div class="topic-metadata">

**Author:** [@mzbyszynski](https://community.apollographql.com/u/mzbyszynski)\
**Replies:** 4\
**Last updated:** [September 29, 2025, 3:53pm UTC](https://community.apollographql.com/t/whats-the-proper-way-to-write-subscribetomore-updatequery-in-typescript/9455 "2025-09-29T15:53:11Z")

</div>

I’m running into some TypeScript challenges after upgrading to Apollo Client 4.x. I’m following this example provided in the docs for using subscribeToMore() from useQuery() The code example has this: const unsubscr…

---

## [Building Agentic UI](https://community.apollographql.com/t/building-agentic-ui/9463)

<div class="topic-metadata">

**Author:** [@kevin\_chu](https://community.apollographql.com/u/kevin_chu)\
**Replies:** 0\
**Last updated:** [September 26, 2025, 10:35pm UTC](https://community.apollographql.com/t/building-agentic-ui/9463 "2025-09-26T22:35:31Z")

</div>

Hey Apollo community! :waving\_hand: We, Apollo, has recently started experimenting with Agentic UI - think making agents capable of knowing the state and context of your UI and be able to interact directly with your UI …

---

## [iOS's SQLiteError doesn't expose underlying SQLite error code](https://community.apollographql.com/t/ioss-sqliteerror-doesnt-expose-underlying-sqlite-error-code/9440)

<div class="topic-metadata">

**Author:** [@potrebic](https://community.apollographql.com/u/potrebic)\
**Replies:** 3\
**Last updated:** [September 16, 2025, 6:11pm UTC](https://community.apollographql.com/t/ioss-sqliteerror-doesnt-expose-underlying-sqlite-error-code/9440 "2025-09-16T18:11:27Z")

</div>

In Pre 1.0 Apollo the calls like: do { return try SQLiteNormalizedCache(fileURL: fileURL) } catch let sqlError as SQLite.Result { ... error handling } would throw the SQLite native SQLite.Result error. This allow…

---

## [Queries not being cached as expected](https://community.apollographql.com/t/queries-not-being-cached-as-expected/9434)

<div class="topic-metadata">

**Author:** [@rmjensen](https://community.apollographql.com/u/rmjensen)\
**Replies:** 4\
**Last updated:** [September 11, 2025, 5:36pm UTC](https://community.apollographql.com/t/queries-not-being-cached-as-expected/9434 "2025-09-11T17:36:03Z")

</div>

Hello, I feel like I’m misunderstanding something essential and it’s resulting it excessive network requests throughout our application whereas I’d expect these requests to be fulfilled by the cache more frequently. Pr…

---

## [Initializing selection set manually without using \_dataDict initializer](https://community.apollographql.com/t/initializing-selection-set-manually-without-using-datadict-initializer/9395)

<div class="topic-metadata">

**Author:** [@pszmurlo](https://community.apollographql.com/u/pszmurlo)\
**Replies:** 8\
**Last updated:** [September 9, 2025, 6:47pm UTC](https://community.apollographql.com/t/initializing-selection-set-manually-without-using-datadict-initializer/9395 "2025-09-09T18:47:28Z")

</div>

We’re migrating from Apollo 0.x to 1.22. We need to initialize Apollo classes manually, because we intercept and “fake” some of GQL endpoint responses. I’m currently using this in Apollo 1.22: let itemDetail = itemDTO.t…

---

## [Apollo Client 4.0 is Here!](https://community.apollographql.com/t/apollo-client-4-0-is-here/9429)

<div class="topic-metadata">

**Author:** [@jerelmiller](https://community.apollographql.com/u/jerelmiller)\
**Replies:** 0\
**Last updated:** [September 3, 2025, 5:26pm UTC](https://community.apollographql.com/t/apollo-client-4-0-is-here/9429 "2025-09-03T17:26:46Z")

</div>

:high\_voltage: Apollo Client 4.0 is Live Apollo Client 4.0 is here, a leaner, cleaner GraphQL client built for modern JavaScript and TypeScript. This release makes apps faster, bundles smaller, and the developer experie…

---

## [Apollo iOS bypassing URLSession's cache-control behaviour by checking its own store first in \`.returnCacheDataElseFetch\`](https://community.apollographql.com/t/apollo-ios-bypassing-urlsessions-cache-control-behaviour-by-checking-its-own-store-first-in-returncachedataelsefetch/9417)

<div class="topic-metadata">

**Author:** [@grse](https://community.apollographql.com/u/grse)\
**Replies:** 2\
**Last updated:** [September 2, 2025, 12:34am UTC](https://community.apollographql.com/t/apollo-ios-bypassing-urlsessions-cache-control-behaviour-by-checking-its-own-store-first-in-returncachedataelsefetch/9417 "2025-09-02T00:34:05Z")

</div>

Hi team, While digging into caching behavior in Apollo iOS, I noticed something I wanted to clarify. In CacheReadInterceptor, the .returnCacheDataElseFetch currently checks Apollo’s store first: case .returnCacheDataEl…

---

## [The hook useQuery is not supported in React Server Components, but only in Client Components](https://community.apollographql.com/t/the-hook-usequery-is-not-supported-in-react-server-components-but-only-in-client-components/9422)

<div class="topic-metadata">

**Author:** [@kmgdev](https://community.apollographql.com/u/kmgdev)\
**Replies:** 2\
**Last updated:** [September 1, 2025, 9:42pm UTC](https://community.apollographql.com/t/the-hook-usequery-is-not-supported-in-react-server-components-but-only-in-client-components/9422 "2025-09-01T21:42:27Z")

</div>

Been trying to get set up in a fresh Next.js install. I’m using the Next.js integration and followed the setup instructions on the Github page. When I try to call useQuery I get this Next.js error: The hook useQuery i…

---

## [How to evict all related queries from cache that reference ids of deleted entities](https://community.apollographql.com/t/how-to-evict-all-related-queries-from-cache-that-reference-ids-of-deleted-entities/9408)

<div class="topic-metadata">

**Author:** [@Temzasse](https://community.apollographql.com/u/Temzasse)\
**Replies:** 7\
**Last updated:** [August 29, 2025, 4:38pm UTC](https://community.apollographql.com/t/how-to-evict-all-related-queries-from-cache-that-reference-ids-of-deleted-entities/9408 "2025-08-29T16:38:56Z")

</div>

Hi :waving\_hand:t2: I’m trying to optimize the way we update the Apollo cache after deleting various entities. The Apollo Client docs have rather good examples about this topic but manually managing the cache can be qui…

---

## [preloadQuery without toPromise in v4](https://community.apollographql.com/t/preloadquery-without-topromise-in-v4/9409)

<div class="topic-metadata">

**Author:** [@BrennenRocks](https://community.apollographql.com/u/BrennenRocks)\
**Replies:** 7\
**Last updated:** [August 28, 2025, 6:44pm UTC](https://community.apollographql.com/t/preloadquery-without-topromise-in-v4/9409 "2025-08-28T18:44:12Z")

</div>

I am currently migrating to v4 React Apollo Client I am also preloading some data with a TanStack Router loader. This is the v3 version loader: ({ params }) =\> preloadQuery(Deal\_Query, { fetchPolicy: 'cache…

---

## [Cookie authentication for ApolloClient and NextJS app router](https://community.apollographql.com/t/cookie-authentication-for-apolloclient-and-nextjs-app-router/9387)

<div class="topic-metadata">

**Author:** [@ty-nielson](https://community.apollographql.com/u/ty-nielson)\
**Replies:** 2\
**Last updated:** [August 19, 2025, 7:51am UTC](https://community.apollographql.com/t/cookie-authentication-for-apolloclient-and-nextjs-app-router/9387 "2025-08-19T07:51:50Z")

</div>

I am working with a NextJS project that needs to access a graphql API. I am using the nextjs app router and am trying to follow the best practices outlined here apollo-client-integrations/packages/nextjs/README.md at 1af…

---

## [Apollo cache js object transformation on read](https://community.apollographql.com/t/apollo-cache-js-object-transformation-on-read/9382)

<div class="topic-metadata">

**Author:** [@itaied](https://community.apollographql.com/u/itaied)\
**Replies:** 2\
**Last updated:** [August 19, 2025, 4:44am UTC](https://community.apollographql.com/t/apollo-cache-js-object-transformation-on-read/9382 "2025-08-19T04:44:17Z")

</div>

hey all i’m using apollo graphql react sdk in my clojurescript project i’m having an issue with the caching mechanism and the transformation of js object to cljs objects. basically, in cljs i’m applying the function “…

---

## [Repeat data in child fragments](https://community.apollographql.com/t/repeat-data-in-child-fragments/9385)

<div class="topic-metadata">

**Author:** [@BrennenRocks](https://community.apollographql.com/u/BrennenRocks)\
**Replies:** 8\
**Last updated:** [August 19, 2025, 2:46am UTC](https://community.apollographql.com/t/repeat-data-in-child-fragments/9385 "2025-08-19T02:46:58Z")

</div>

Using the client-preset and React and following this article Unleash the power of Fragments with GraphQL Codegen | Hive I have a question about displaying the same field in multiple components as it traverses down the tr…

---

## [Negative Request Timing from URLSession delegate for TransactionMetrics](https://community.apollographql.com/t/negative-request-timing-from-urlsession-delegate-for-transactionmetrics/9317)

<div class="topic-metadata">

**Author:** [@Reshu\_Malik](https://community.apollographql.com/u/Reshu_Malik)\
**Replies:** 3\
**Last updated:** [August 15, 2025, 10:51pm UTC](https://community.apollographql.com/t/negative-request-timing-from-urlsession-delegate-for-transactionmetrics/9317 "2025-08-15T22:51:00Z")

</div>

Hello, We recently had a surge in following issue, although this seems like something that always existed (With Apollo iOS 0.x too). We implement urlSession(\_:task:didFinishCollecting:) delegate method and collect requ…

---

## [Apollo iOS 1.22.0 always converts Date variables to UTC, dropping their original time zone information](https://community.apollographql.com/t/apollo-ios-1-22-0-always-converts-date-variables-to-utc-dropping-their-original-time-zone-information/9336)

<div class="topic-metadata">

**Author:** [@p\_lizak](https://community.apollographql.com/u/p_lizak)\
**Replies:** 2\
**Last updated:** [August 5, 2025, 10:57am UTC](https://community.apollographql.com/t/apollo-ios-1-22-0-always-converts-date-variables-to-utc-dropping-their-original-time-zone-information/9336 "2025-08-05T10:57:50Z")

</div>

Description When I send a Date object using Apollo 1.22.0, it’s automatically converted to UTC, so we lose the client’s time zone and the backend misses that potentially useful information. We could pre-format dates as …

---

## [Eliding namespace for code generation embedded in a module](https://community.apollographql.com/t/eliding-namespace-for-code-generation-embedded-in-a-module/8924)

<div class="topic-metadata">

**Author:** [@rajivjhoomuck](https://community.apollographql.com/u/rajivjhoomuck)\
**Replies:** 1\
**Last updated:** [July 24, 2025, 7:55pm UTC](https://community.apollographql.com/t/eliding-namespace-for-code-generation-embedded-in-a-module/8924 "2025-07-24T19:55:43Z")

</div>

Hello, I am writing a command plugin (SPM) and I already have a module where I want to embed the generated source files. This is part of the outport object in the config file: "schemaTypes" : { "moduleType" : { …

---

## [Avoiding fallback component after initial load with \`useSuspenseQuery\` when automatically refreshing data](https://community.apollographql.com/t/avoiding-fallback-component-after-initial-load-with-usesuspensequery-when-automatically-refreshing-data/9279)

<div class="topic-metadata">

**Author:** [@SeerUK](https://community.apollographql.com/u/SeerUK)\
**Replies:** 2\
**Last updated:** [July 9, 2025, 12:39pm UTC](https://community.apollographql.com/t/avoiding-fallback-component-after-initial-load-with-usesuspensequery-when-automatically-refreshing-data/9279 "2025-07-09T12:39:23Z")

</div>

I’m trying to make a React context provider which runs a query, and then allows it’s children to render. I was thinking it’d be nice to do this with Suspense, because I could have other providers that load essential dat…

---

## [Best practices: reading a dynamic number of fragments](https://community.apollographql.com/t/best-practices-reading-a-dynamic-number-of-fragments/9271)

<div class="topic-metadata">

**Author:** [@tpict](https://community.apollographql.com/u/tpict)\
**Replies:** 3\
**Last updated:** [July 7, 2025, 4:19pm UTC](https://community.apollographql.com/t/best-practices-reading-a-dynamic-number-of-fragments/9271 "2025-07-07T16:19:37Z")

</div>

Imagine a scenario where you have a list of GraphQL IDs–perhaps stored in the variables of a useQuery call–and you want to read fields of theirs for use in business logic. If you’re just displaying those fields, you cou…

---

## [How to use a server-component on the client? (nextjs)](https://community.apollographql.com/t/how-to-use-a-server-component-on-the-client-nextjs/9256)

<div class="topic-metadata">

**Author:** [@AndiBonifacio](https://community.apollographql.com/u/AndiBonifacio)\
**Replies:** 7\
**Last updated:** [July 1, 2025, 3:37pm UTC](https://community.apollographql.com/t/how-to-use-a-server-component-on-the-client-nextjs/9256 "2025-07-01T15:37:00Z")

</div>

I’m a bit confused how to make Nextjs paradigm work with pre-rendering something in a server component via Apollo. I get an error when I try to employ this approach: 'use client'; import {useSelectedLayoutSegments} fro…

---

## [Generate queryRefs for unit tests](https://community.apollographql.com/t/generate-queryrefs-for-unit-tests/9258)

<div class="topic-metadata">

**Author:** [@RMHonor](https://community.apollographql.com/u/RMHonor)\
**Replies:** 1\
**Last updated:** [July 1, 2025, 8:41am UTC](https://community.apollographql.com/t/generate-queryrefs-for-unit-tests/9258 "2025-07-01T08:41:32Z")

</div>

Is there an idiomatic way to generate query refs with Apollo client for use in unit tests? I’m wondering if we could use the MockLink in a new client, passing in our mocks as we would a MockedProvider, then wrap the clie…

---

## [Can I Use Reactive Variables Instead of fetchMore() and refetchQueries()?](https://community.apollographql.com/t/can-i-use-reactive-variables-instead-of-fetchmore-and-refetchqueries/9158)

<div class="topic-metadata">

**Author:** [@kmgdev](https://community.apollographql.com/u/kmgdev)\
**Replies:** 16\
**Last updated:** [June 27, 2025, 7:26pm UTC](https://community.apollographql.com/t/can-i-use-reactive-variables-instead-of-fetchmore-and-refetchqueries/9158 "2025-06-27T19:26:45Z")

</div>

For a more detailed explanation you can view my question on Stack Overflow I’m using Apollo with Next.js to connect to a headless CMS (Craft CMS). I need to fetch a list of entries from the cms, paginate those entries u…

[Previous page](https://community.apollographql.com/c/client-sdk/21.md)

[Next page](https://community.apollographql.com/c/client-sdk/21.md?page=2)
