# Client SDKs

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

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

**Page:** 3

---

## [Android Best Practice: Mocking Fragments vs. Using Separate UI Models?](https://community.apollographql.com/t/android-best-practice-mocking-fragments-vs-using-separate-ui-models/9235)

<div class="topic-metadata">

**Author:** [@Lana\_Mozharovska](https://community.apollographql.com/u/Lana_Mozharovska)\
**Replies:** 4\
**Last updated:** [June 24, 2025, 3:14pm UTC](https://community.apollographql.com/t/android-best-practice-mocking-fragments-vs-using-separate-ui-models/9235 "2025-06-24T15:14:22Z")

</div>

I have a design pattern question regarding apollo-kotlin on Android, specifically about the best way to structure data for the UI layer (Jetpack Compose) to allow for easy testing and previews. There seem to be two comm…

---

## [How to Mock Apollo Client GraphQL Calls for E2E Testing in Next.js v12?](https://community.apollographql.com/t/how-to-mock-apollo-client-graphql-calls-for-e2e-testing-in-next-js-v12/9233)

<div class="topic-metadata">

**Author:** [@Yash\_Boura](https://community.apollographql.com/u/Yash_Boura)\
**Replies:** 0\
**Last updated:** [June 24, 2025, 3:41am UTC](https://community.apollographql.com/t/how-to-mock-apollo-client-graphql-calls-for-e2e-testing-in-next-js-v12/9233 "2025-06-24T03:41:56Z")

</div>

Hi everyone, I’m working on a Next.js v12 application that uses Apollo Client for GraphQL operations, and I’m struggling with mocking GraphQL calls during E2E testing while maintaining a single Apollo Client instance. M…

---

## [Query using beginWith](https://community.apollographql.com/t/query-using-beginwith/9183)

<div class="topic-metadata">

**Author:** [@Viraj\_Thakur](https://community.apollographql.com/u/Viraj_Thakur)\
**Replies:** 2\
**Last updated:** [June 17, 2025, 7:48am UTC](https://community.apollographql.com/t/query-using-beginwith/9183 "2025-06-17T07:48:02Z")

</div>

I have a model defined as follows: type TempModel @model { pk: ID! @primaryKey(sortKeyFields: \["sk"\]) sk: String! } I want to perform a beginsWith query on the sk field. I noticed that getTempModel doesn’t support …

---

## [useQuery typing not working without @graphql-typed-document-node](https://community.apollographql.com/t/usequery-typing-not-working-without-graphql-typed-document-node/9185)

<div class="topic-metadata">

**Author:** [@JakeOTooleDev](https://community.apollographql.com/u/JakeOTooleDev)\
**Replies:** 6\
**Last updated:** [June 13, 2025, 3:33pm UTC](https://community.apollographql.com/t/usequery-typing-not-working-without-graphql-typed-document-node/9185 "2025-06-13T15:33:40Z")

</div>

I followed various tutorials to setup generating types using codegen, such as TypeScript with Apollo Client - Apollo GraphQL Docs. Everything was working great. Then, I noticed that @graphql-typed-document-node/core wa…

---

## [Cursor Based Pagination caching](https://community.apollographql.com/t/cursor-based-pagination-caching/9174)

<div class="topic-metadata">

**Author:** [@BrennenRocks](https://community.apollographql.com/u/BrennenRocks)\
**Replies:** 1\
**Last updated:** [June 11, 2025, 8:00pm UTC](https://community.apollographql.com/t/cursor-based-pagination-caching/9174 "2025-06-11T20:00:27Z")

</div>

I have implemented cursor based pagination and its working as expected for my first call through useBackgroundQuery and useReadQuery. When I call fetchMore it will appropriately call the resolver with the after marked an…

---

## [Apollo graphql throwing errors on frontend when there are some fields missing in the graph ql response](https://community.apollographql.com/t/apollo-graphql-throwing-errors-on-frontend-when-there-are-some-fields-missing-in-the-graph-ql-response/9169)

<div class="topic-metadata">

**Author:** [@optimistic](https://community.apollographql.com/u/optimistic)\
**Replies:** 2\
**Last updated:** [June 10, 2025, 9:46pm UTC](https://community.apollographql.com/t/apollo-graphql-throwing-errors-on-frontend-when-there-are-some-fields-missing-in-the-graph-ql-response/9169 "2025-06-10T21:46:12Z")

</div>

Query : query sample { accountBalance(issuanceRequired: true) { uCardAccountBalance { purses { uCardPurseType promotionId availableAmount start…

---

## [Enabling flexibility for iOS cache](https://community.apollographql.com/t/enabling-flexibility-for-ios-cache/9140)

<div class="topic-metadata">

**Author:** [@ChrisLaganiere](https://community.apollographql.com/u/ChrisLaganiere)\
**Replies:** 1\
**Last updated:** [June 4, 2025, 5:12pm UTC](https://community.apollographql.com/t/enabling-flexibility-for-ios-cache/9140 "2025-06-04T17:12:08Z")

</div>

Hi! I am aiming to empower consumers of the iOS sdk to build their own solutions to different problems by making the local cache more flexible. A simple change to the sdk would allow developers to solve for their own cus…

---

## [Earliest Version of Apollo client which supports @defer fully](https://community.apollographql.com/t/earliest-version-of-apollo-client-which-supports-defer-fully/9127)

<div class="topic-metadata">

**Author:** [@WEe](https://community.apollographql.com/u/WEe)\
**Replies:** 1\
**Last updated:** [June 2, 2025, 10:14am UTC](https://community.apollographql.com/t/earliest-version-of-apollo-client-which-supports-defer-fully/9127 "2025-06-02T10:14:01Z")

</div>

Hey all! As of right now, our current used version of Apollo client is 3.7.2, which to my understanding, supports @defer, to some extent? We need to add full support for @defer, but I’m not sure which version has full s…

---

## [Fragments: Use in the UI or map to a model?](https://community.apollographql.com/t/fragments-use-in-the-ui-or-map-to-a-model/9119)

<div class="topic-metadata">

**Author:** [@Hunter\_Freas](https://community.apollographql.com/u/Hunter_Freas)\
**Replies:** 1\
**Last updated:** [May 30, 2025, 3:15pm UTC](https://community.apollographql.com/t/fragments-use-in-the-ui-or-map-to-a-model/9119 "2025-05-30T15:15:21Z")

</div>

Hello, I was wondering about the usage of Fragments in the UI. If you are trying to follow a more clean architecture approach, a Fragment would be considered a DTO and then should be mapped to a model from the domain to …

---

## [How can I mock a realistic response from the Apollo Client?](https://community.apollographql.com/t/how-can-i-mock-a-realistic-response-from-the-apollo-client/9104)

<div class="topic-metadata">

**Author:** [@Hunter\_Freas](https://community.apollographql.com/u/Hunter_Freas)\
**Replies:** 2\
**Last updated:** [May 28, 2025, 5:31am UTC](https://community.apollographql.com/t/how-can-i-mock-a-realistic-response-from-the-apollo-client/9104 "2025-05-28T05:31:06Z")

</div>

Hello, I am currently trying to make tests using the Apollo Client and I would like to get realistic mocked responses from the Apollo Client. I would like to create a class that returns mock responses from the Apollo Cli…

---

## [preloadQuery with Tanstack Router loader](https://community.apollographql.com/t/preloadquery-with-tanstack-router-loader/9100)

<div class="topic-metadata">

**Author:** [@BrennenRocks](https://community.apollographql.com/u/BrennenRocks)\
**Replies:** 11\
**Last updated:** [May 23, 2025, 1:07pm UTC](https://community.apollographql.com/t/preloadquery-with-tanstack-router-loader/9100 "2025-05-23T13:07:16Z")

</div>

I am attempting to use preloadQuery with the Tanstack router loader function loader: ({ params }) =\> { return preloadQuery(DealQuery, { variables: { dealId: params.dealId }, }); }, Then in the compone…

---

## [📣 The new Apollo Kotlin Normalized Cache is here!](https://community.apollographql.com/t/the-new-apollo-kotlin-normalized-cache-is-here/9083)

<div class="topic-metadata">

**Author:** [@Benoit\_Lubek](https://community.apollographql.com/u/Benoit_Lubek)\
**Replies:** 0\
**Last updated:** [May 20, 2025, 2:58pm UTC](https://community.apollographql.com/t/the-new-apollo-kotlin-normalized-cache-is-here/9083 "2025-05-20T14:58:23Z")

</div>

:megaphone: The new Apollo Kotlin Normalized Cache is here, now in GA! We’ve been working over the past year on this new version, bringing: Pagination support Expiration (TTL) Garbage collection and trimming Partial r…

---

## [Any way to subscribe for network status of queryRef?](https://community.apollographql.com/t/any-way-to-subscribe-for-network-status-of-queryref/9030)

<div class="topic-metadata">

**Author:** [@misha-erm](https://community.apollographql.com/u/misha-erm)\
**Replies:** 5\
**Last updated:** [May 12, 2025, 9:23pm UTC](https://community.apollographql.com/t/any-way-to-subscribe-for-network-status-of-queryref/9030 "2025-05-12T21:23:50Z")

</div>

Hello, I’m building some search experience and would like to know if there is any way to subscribe for queryRef network status without using suspense? So I have a search input and on change I update query params. When …

---

## [Mutating cache crashing immediately](https://community.apollographql.com/t/mutating-cache-crashing-immediately/8437)

<div class="topic-metadata">

**Author:** [@arvinshen](https://community.apollographql.com/u/arvinshen)\
**Replies:** 1\
**Last updated:** [May 7, 2025, 7:19pm UTC](https://community.apollographql.com/t/mutating-cache-crashing-immediately/8437 "2025-05-07T19:19:06Z")

</div>

I am trying to mutate my cache, but it is crashing immediately when using ApolloStore.withinReadWriteTransaction(\_:callbackQueue:completion:) and need help troubleshooting as I don’t know what is causing this issue. I re…

---

## [Apollo Client Cache: Type-level Merge Policy for Nested Objects Not Being Applied](https://community.apollographql.com/t/apollo-client-cache-type-level-merge-policy-for-nested-objects-not-being-applied/8965)

<div class="topic-metadata">

**Author:** [@Ali\_Hashemi](https://community.apollographql.com/u/Ali_Hashemi)\
**Replies:** 1\
**Last updated:** [April 25, 2025, 4:44pm UTC](https://community.apollographql.com/t/apollo-client-cache-type-level-merge-policy-for-nested-objects-not-being-applied/8965 "2025-04-25T16:44:49Z")

</div>

I’m having an issue with Apollo Client’s cache where my type-level merge policy for CustomFieldValue isn’t being applied when I update a Entry that contains it. My Setup Type Structure: type Entry { entryUrn: String!…

---

## [Does Apollo Kotlin have a way to see if result came from cache or server?](https://community.apollographql.com/t/does-apollo-kotlin-have-a-way-to-see-if-result-came-from-cache-or-server/8977)

<div class="topic-metadata">

**Author:** [@josh\_josh\_josh](https://community.apollographql.com/u/josh_josh_josh)\
**Replies:** 1\
**Last updated:** [April 25, 2025, 9:11am UTC](https://community.apollographql.com/t/does-apollo-kotlin-have-a-way-to-see-if-result-came-from-cache-or-server/8977 "2025-04-25T09:11:33Z")

</div>

Does Apollo Kotlin have a way to see if result came from cache or server? Apollo iOS has GraphQLResult .cache or .server. Does Kotlin have anything similar? I’ve been unable to find anything searching and digging throug…

---

## [Does Apollo Kotlin have a way to see result source?](https://community.apollographql.com/t/does-apollo-kotlin-have-a-way-to-see-result-source/8975)

<div class="topic-metadata">

**Author:** [@josh\_josh\_josh](https://community.apollographql.com/u/josh_josh_josh)\
**Replies:** 0\
**Last updated:** [April 25, 2025, 4:50am UTC](https://community.apollographql.com/t/does-apollo-kotlin-have-a-way-to-see-result-source/8975 "2025-04-25T04:50:53Z")

</div>

Does Apollo Kotlin have a way to see if a result came from the cache or server? Apollo iOS GraphQLResult has a Source enum. Does Kotlin have anything similar to say where a result came from? cache or server?

---

## [Increased query complexity when using fragment colocation](https://community.apollographql.com/t/increased-query-complexity-when-using-fragment-colocation/8928)

<div class="topic-metadata">

**Author:** [@Omar\_Ayman](https://community.apollographql.com/u/Omar_Ayman)\
**Replies:** 1\
**Last updated:** [April 16, 2025, 9:40am UTC](https://community.apollographql.com/t/increased-query-complexity-when-using-fragment-colocation/8928 "2025-04-16T09:40:51Z")

</div>

if I have a query like query Posts { posts { id title description } } and extract some fields to a fragment like this query Posts { posts { id title ... Description } } fragment Descrip…

---

## [Cache performance debugging](https://community.apollographql.com/t/cache-performance-debugging/8881)

<div class="topic-metadata">

**Author:** [@daronimo](https://community.apollographql.com/u/daronimo)\
**Replies:** 3\
**Last updated:** [April 14, 2025, 4:45pm UTC](https://community.apollographql.com/t/cache-performance-debugging/8881 "2025-04-14T16:45:02Z")

</div>

Hey all - Following up in this forum after speaking in person with some members of your team last week. We were wondering if there was any general advice for how to debug or instrument the Apollo Client cache performanc…

---

## [Parse JSON response into GraphQL response with alias and custom adapter](https://community.apollographql.com/t/parse-json-response-into-graphql-response-with-alias-and-custom-adapter/8895)

<div class="topic-metadata">

**Author:** [@PuneetS](https://community.apollographql.com/u/PuneetS)\
**Replies:** 2\
**Last updated:** [April 14, 2025, 6:25am UTC](https://community.apollographql.com/t/parse-json-response-into-graphql-response-with-alias-and-custom-adapter/8895 "2025-04-14T06:25:57Z")

</div>

Hi I have a use-case of parsing a JSON response into GraphQL response using adapters autogenerated by Apollo Kotlin. I have defined some aliases into my GraphQL query which i want to be mapped accordingly but since ther…

---

## [Grouping keyArgs for pagination when using before and after cursor](https://community.apollographql.com/t/grouping-keyargs-for-pagination-when-using-before-and-after-cursor/8872)

<div class="topic-metadata">

**Author:** [@ookil](https://community.apollographql.com/u/ookil)\
**Replies:** 1\
**Last updated:** [April 9, 2025, 5:36pm UTC](https://community.apollographql.com/t/grouping-keyargs-for-pagination-when-using-before-and-after-cursor/8872 "2025-04-09T17:36:52Z")

</div>

Hello, I have run into an issue with caching when it comes to my pagination. my query accepts this args query CatalogedPaints( $brandId: String $categoryId: String $color: PaintColor $search: String $after: …

---

## [Fetching Data using Mutations on running Sandbox getting all fields types response perfectly. But in iOS Client side some fields getting 0 values instead of data](https://community.apollographql.com/t/fetching-data-using-mutations-on-running-sandbox-getting-all-fields-types-response-perfectly-but-in-ios-client-side-some-fields-getting-0-values-instead-of-data/8855)

<div class="topic-metadata">

**Author:** [@shravanteegala](https://community.apollographql.com/u/shravanteegala)\
**Replies:** 1\
**Last updated:** [April 9, 2025, 3:44pm UTC](https://community.apollographql.com/t/fetching-data-using-mutations-on-running-sandbox-getting-all-fields-types-response-perfectly-but-in-ios-client-side-some-fields-getting-0-values-instead-of-data/8855 "2025-04-09T15:44:13Z")

</div>

Fetching Data using Mutations on running Sandbox getting all fields types response perfectly. But in iOS Client side some fields getting 0 values instead of data. Scenario:1 : Below example in Sandbox environment gett…

---

## [Cache data loss warning on fully normalized query](https://community.apollographql.com/t/cache-data-loss-warning-on-fully-normalized-query/8749)

<div class="topic-metadata">

**Author:** [@jhgrund](https://community.apollographql.com/u/jhgrund)\
**Replies:** 4\
**Last updated:** [March 31, 2025, 9:40am UTC](https://community.apollographql.com/t/cache-data-loss-warning-on-fully-normalized-query/8749 "2025-03-31T09:40:39Z")

</div>

Hey :slight\_smile: We have a schema, where part of it is type User implements Node { id: ID! fullName: String reports: \[Report!\]! } type Report { id: ID! name: String! } union MutationDeleteReportResult = B…

---

## [Proper error handling with useLazyQuery](https://community.apollographql.com/t/proper-error-handling-with-uselazyquery/8796)

<div class="topic-metadata">

**Author:** [@Branden\_Boucher](https://community.apollographql.com/u/Branden_Boucher)\
**Replies:** 2\
**Last updated:** [March 28, 2025, 5:49pm UTC](https://community.apollographql.com/t/proper-error-handling-with-uselazyquery/8796 "2025-03-28T17:49:35Z")

</div>

Hello all. First, apologies if there is already a topic for this. I searched and did not find anything similar or with a viable answer. The setup: in our web app, it’s pretty common for us to query data based on user i…

---

## [Apllo error link - stacktrace](https://community.apollographql.com/t/apllo-error-link-stacktrace/8818)

<div class="topic-metadata">

**Author:** [@Lior\_Pevzner](https://community.apollographql.com/u/Lior_Pevzner)\
**Replies:** 0\
**Last updated:** [March 28, 2025, 5:30pm UTC](https://community.apollographql.com/t/apllo-error-link-stacktrace/8818 "2025-03-28T17:30:41Z")

</div>

Hi. Im using Apollo client, and Im sending exceptions to my Sentry in my Apollo link function, the problem with that is I’m losing the original stack-trace of my graphQL error since error link formats the original error…

---

## [relayStylePagination doesn't check if edges were actually queried](https://community.apollographql.com/t/relaystylepagination-doesnt-check-if-edges-were-actually-queried/8731)

<div class="topic-metadata">

**Author:** [@tpict](https://community.apollographql.com/u/tpict)\
**Replies:** 3\
**Last updated:** [March 26, 2025, 4:13pm UTC](https://community.apollographql.com/t/relaystylepagination-doesnt-check-if-edges-were-actually-queried/8731 "2025-03-26T16:13:01Z")

</div>

I’m encountering an issue where I have two documents querying the same field, which is configured to use relayStylePagination with the relevant key args. One of those documents doesn’t include edges in its selection set…

---

## [Schedule App Refresh in the background](https://community.apollographql.com/t/schedule-app-refresh-in-the-background/8751)

<div class="topic-metadata">

**Author:** [@rajivjhoomuck](https://community.apollographql.com/u/rajivjhoomuck)\
**Replies:** 4\
**Last updated:** [March 24, 2025, 11:10pm UTC](https://community.apollographql.com/t/schedule-app-refresh-in-the-background/8751 "2025-03-24T23:10:09Z")

</div>

Hi, When my app is in the background, I need to wake it up periodically to refresh data. I am not sure how to achieve that since, from what I have seen so far, the URLSessionConfiguration that is passed to the URLSessio…

---

## [Parse JSON response to GraphQL](https://community.apollographql.com/t/parse-json-response-to-graphql/8755)

<div class="topic-metadata">

**Author:** [@Amit\_M](https://community.apollographql.com/u/Amit_M)\
**Replies:** 1\
**Last updated:** [March 22, 2025, 7:46am UTC](https://community.apollographql.com/t/parse-json-response-to-graphql/8755 "2025-03-22T07:46:48Z")

</div>

How can I parse a stored JSON response in React and pass to a component that is expecting graphql response? This is what I am trying, but it is not reading the data correctly: const client = new ApolloClient({ cache:…

---

## [How to create a GraphQL response from json?](https://community.apollographql.com/t/how-to-create-a-graphql-response-from-json/7824)

<div class="topic-metadata">

**Author:** [@JanC](https://community.apollographql.com/u/JanC)\
**Replies:** 2\
**Last updated:** [March 21, 2025, 5:27pm UTC](https://community.apollographql.com/t/how-to-create-a-graphql-response-from-json/7824 "2025-03-21T17:27:54Z")

</div>

Hi, I have a saved json response of GetCustomersQuery and I’d like to instantiante the GetCustomersQuery.Data using that saved file. It is described in the docs but when I do it, I get the exception JSONDecodingError.mi…

---

## [Apollo Client v4 alpha releases are here!](https://community.apollographql.com/t/apollo-client-v4-alpha-releases-are-here/8719)

<div class="topic-metadata">

**Author:** [@JeffAuriemma](https://community.apollographql.com/u/JeffAuriemma)\
**Replies:** 0\
**Last updated:** [March 18, 2025, 4:51pm UTC](https://community.apollographql.com/t/apollo-client-v4-alpha-releases-are-here/8719 "2025-03-18T16:51:54Z")

</div>

I’ve got good news and better news. The good news is that Apollo Client 4.0 alphas are now being released: The better news is that this comes with ESM support and a significantly smaller bundle size, see the changelo…

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

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