# GraphQL Clients

> Query exactly the data a screen needs with GraphQL, using clients such as Apollo, urql or graphqlflutter with normalised caching. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/mobile/graphql
Last updated: 2026-11-28

Query exactly the data a screen needs with GraphQL, using clients such as Apollo, urql or graphql_flutter with normalised caching.

Intermediate · about 5 hours · difficulty 3/5

Learn first: [Networking Clients & Server-state Caching](https://www.internhack.in/roadmaps/tracks/mobile/networking-clients)

GraphQL lets the client ask for exactly the fields it needs in one request, which suits mobile screens that combine data from several resources.

### Concepts

- A **schema** defines types and fields. **Queries** read, **mutations** write, **subscriptions** stream updates.
- **Fragments** let each component declare its data needs.
- Variables pass arguments: `query Order($id: ID!) { order(id: $id) { id total items { name } } }`.

### Clients

- **Apollo Client** or **urql** for React Native, Apollo Kotlin for Android, Apollo iOS, and graphql_flutter or Ferry for Flutter.
- **Normalised caching** stores objects by `__typename` and `id`, so updating an order in one screen updates it everywhere.
- **Code generation** (GraphQL Code Generator, Apollo codegen) produces typed hooks and models from the schema.

### Trade-offs

GraphQL shines with complex, nested data and many client types. For simple CRUD APIs, REST with a query cache is often simpler. Watch out for over-fetching through huge queries and for pagination patterns (connections, cursors).

**Good enough to move on:** you can write a query with variables and fragments, run it through a typed client, and see a mutation update the cache.

## Key concepts

- **Schema, queries and mutations**
- **Variables and fragments**
- **Normalised cache**
- **Code generation for types**
- **Cursor pagination**
- **Subscriptions**

## Mini project

Build a country explorer app using a public GraphQL countries API, with a list screen, a detail screen, and typed generated queries.

## Check yourself

What does a normalised cache do when a mutation returns an updated object with an id already in the cache?

## Free resources

- [Learn GraphQL](https://graphql.org/learn/) (GraphQL Foundation)
- [Apollo Client for React](https://www.apollographql.com/docs/react/) (Apollo)

Previous: [Networking Clients & Server-state Caching](https://www.internhack.in/roadmaps/tracks/mobile/networking-clients) · Next: [Local Storage: Key-value, SQLite & Files](https://www.internhack.in/roadmaps/tracks/mobile/local-storage)

## More in Data: Networking, Storage & Offline-first

- [HTTP & REST APIs for App Developers](https://www.internhack.in/roadmaps/tracks/mobile/http)
- [Networking Clients & Server-state Caching](https://www.internhack.in/roadmaps/tracks/mobile/networking-clients)
- [GraphQL Clients](https://www.internhack.in/roadmaps/tracks/mobile/graphql)
- [Local Storage: Key-value, SQLite & Files](https://www.internhack.in/roadmaps/tracks/mobile/local-storage)
- [Offline-first & Data Synchronisation](https://www.internhack.in/roadmaps/tracks/mobile/offline-first)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Mobile App Developer Roadmap](https://www.internhack.in/roadmaps/tracks/mobile)
