GraphQL Roadmap

GraphQL is a way to design and query APIs in which the client states exactly which data it wants and the server answers with that shape. Teams use it when many clients share one backend, when screens need data from several places, or when front-end and backend teams want a typed contract they can both build against.

This roadmap starts with the idea and the query language, then covers the type system, resolvers, the N+1 problem, caching and pagination. It continues with serving over HTTP and WebSockets, security, server libraries in several languages, client libraries and federation. Each topic has a short explanation and an exercise.

By the end you will be able to design a schema, build and secure a server, consume it from a client, and answer the questions interviewers ask about performance and trade-offs against REST. Practise in coding practice and track progress in progress page.

Level
Beginner to advanced
Time
8-12 weeks at about 8 hours a week
Scope
53 topics in 9 stages
Before you start
Working knowledge of one backend language, such as JavaScript Roadmap, Python Roadmap or Java Roadmap; Basic HTTP and JSON, and how REST APIs work (see API Design Roadmap); Basic database ideas from SQL Roadmap, since resolvers usually read from one; Comfort with the terminal and Git and GitHub Roadmap

What you will be able to do

  • Write queries, mutations and subscriptions with variables, fragments and directives.
  • Design a typed schema with careful nullability, enums, interfaces, unions and pagination.
  • Implement resolvers and remove N+1 problems with batching.
  • Serve GraphQL over HTTP, WebSockets and server-sent events with authentication and authorisation.
  • Protect a public endpoint with depth, cost and rate limits.
  • Consume an API from a client with a normalised cache and generated types.
  • Explain federation, schema evolution and the trade-offs between GraphQL and REST.

The roadmap at a glance

  1. Stage 1Why GraphQLBeginner · 1 week · 4 topics
  2. Stage 2Writing QueriesBeginner · 1-2 weeks · 7 topics
  3. Stage 3Mutations and Real-TimeIntermediate · 1-2 weeks · 7 topics
  4. Stage 4Schema and Type SystemIntermediate · 2 weeks · 9 topics
  5. Stage 5Execution and ResolversIntermediate · 2 weeks · 7 topics
  6. Stage 6Serving GraphQL and Securing ItIntermediate · 2 weeks · 6 topics
  7. Stage 7GraphQL on the BackendIntermediate · 2-3 weeks · 6 topics
  8. Stage 8GraphQL on the FrontendIntermediate · 2 weeks · 4 topics
  9. Stage 9Scaling and ProductionAdvanced · 2 weeks · 3 topics

Stage 1 Why GraphQL

Beginner1 week4 topics

Goal. Explain what GraphQL is, which problems it addresses, and how to think about data as a graph.

GraphQL Introduction Core

What is GraphQL? It is a query language for APIs and a runtime that answers those queries against a typed schema. A client sends a description of the data it wants, and the server returns a JSON object with exactly that shape. There is usually one endpoint, and the request body decides what happens.

GraphQL was created at Facebook to serve its mobile apps and is now maintained by a foundation with an open specification. It is not a database technology and it does not care what sits behind it: SQL tables, other REST services or a message queue can all feed a GraphQL server.

The three operation types are queries (read), mutations (write) and subscriptions (stream of events). Everything a client may ask for is described in the schema.

Practice. Write two sentences describing GraphQL to a teammate who has only used REST.

Problems GraphQL Solves Core

GraphQL grew out of three recurring pains with resource-style APIs.

  • Over-fetching: an endpoint returns a large record when a screen needs two fields.
  • Under-fetching: a screen needs data from several endpoints, so the client makes several round trips and stitches the results.
  • Slow coordination: front-end teams wait for new endpoints, or backend teams keep adding one-off ones.

A single typed graph lets each client ask for what it needs, which helps most when many different clients (web, iOS, Android, partners) share one backend. It also gives you a living contract: the schema documents itself.

It does not remove all problems. Caching is harder, a naive server can issue many database queries, and a public endpoint needs protection against expensive queries. Later stages cover these. See API Design Roadmap for how it compares with REST.

Practice. List three screens in an app you know and, for each, the REST calls it would need versus one GraphQL query.

Thinking in Graphs Core

Model your domain as nodes (things such as users, orders and products) connected by edges (relationships such as an order having line items). A query is a path through that graph, starting at a root and walking outwards.

This changes how you design. Instead of asking what endpoints a screen needs, you ask which types exist and how they relate. A User links to Posts, a Post links back to its author, and any client can walk either direction as long as the schema allows it.

Be careful with cycles. A schema where author leads to posts leads to author is fine, but a client could ask for it nested twenty levels deep. Limiting depth and cost is a server concern covered in the security stage.

Think in terms of the business domain, not your database tables. The graph that clients see should be the one that makes sense to them.

Practice. Sketch a graph for an online shop with at least five types and label each edge as one-to-one or one-to-many.

Specification Recommended

GraphQL is defined by a written specification, not by a single product. It describes the query language grammar, the type system, how validation works, how execution proceeds and what the response looks like. Libraries in many languages implement it, which is why the same query works against a server written in JavaScript, Java, Go or Python.

The specification is versioned by dated releases and developed in the open through working-group proposals. Features move through stages from idea to accepted. Some capabilities discussed in this roadmap, such as incremental delivery, are still proposals in some implementations, so check what your library supports.

You do not need to memorise the document. It pays to read the execution and validation sections once, because they answer most interview questions about how a query is processed. The separate specification for serving GraphQL over HTTP is covered in a later stage.

Practice. Read the validation section of the specification and list three rules a query must satisfy.

Stage 2 Writing Queries

Beginner1-2 weeks7 topics

Goal. Write queries with arguments, aliases, variables, fragments and directives against any GraphQL API.

GraphQL Queries Core

A query is a read-only operation. It is a tree of selections that mirrors the shape of the response. Anything you select appears in the result; anything you leave out does not.

query {
  product(id: "42") {
    name
    price
    reviews { rating }
  }
}

The response is JSON with a top-level data key, and optionally errors. The result keys follow your query, so you can rely on the shape. Selection sets are mandatory on object types: you cannot ask for product alone, you must choose fields. Scalars such as strings and numbers are leaves and take no selection.

Queries may run their top-level fields in parallel, because reading should not change state.

What are queries in design terms? They are entry points on the root Query type, which should stay small and domain-focused. Name every operation and use variables.

Give each operation a name, such as ProductPage. The operation name does not change the result, but it appears in logs, traces and error reports, and it is required to choose one operation from a document that holds several.

Practice. Write a query that returns an item, its nested owner and two fields of the owner, and predict the JSON shape before running it.

Fields Core

Fields are the units of data in GraphQL. Every field belongs to a type and has its own return type. When you select a field, the server runs the code that produces that value, so the selection set is also a list of work to do.

Fields can be simple values, other objects or lists of either. A field can also take arguments, which makes it behave like a function:

type User {
  name: String!
  avatarUrl(size: Int = 64): String
}

Because each field is resolved independently, one expensive field costs nothing unless a client asks for it. That is a real advantage, and also the reason a query can be much more costly than it looks. Fields may be deprecated, which keeps them working while telling clients to move away.

Root fields are the fields on the Query, Mutation and Subscription root types, where execution starts. Query root fields may run in parallel and mutation root fields run in order. Each one is a public entry point and a long-term commitment, so prefer a few meaningful ones such as a node lookup by global ID or a viewer field.

Practice. Add an argument with a default value to one field in a small schema and query it with and without the argument.

Arguments Core

Arguments let a field take named inputs. They are written in parentheses and must match the types in the schema, including whether a value is required.

{
  products(category: "books", first: 10, sort: PRICE_ASC) {
    name
  }
}

Arguments can be scalars, enums or input objects. Use them for filtering, pagination, sorting and looking up by ID. Put the identity of the thing in an argument and the shape of the answer in the selection set.

Arguments on nested fields are allowed too, for example posts(first: 3) inside a user. The server must then apply that argument for each parent, which has performance consequences you will meet in the N+1 discussion. Required arguments are marked with !. Unknown arguments fail validation.

Practice. Query a list field with a filter, a limit and a sort order, then change each argument to see its effect.

Aliases Recommended

An alias renames a field in the result. This is needed when you want the same field twice with different arguments, because two results cannot share one key.

{
  small: avatarUrl(size: 32)
  large: avatarUrl(size: 256)
}

Without aliases the second avatarUrl would conflict with the first and the query would be rejected. Aliases also help when you want response keys that match your client code, though renaming just for taste adds noise.

Use them sparingly, for real conflicts or to compare two lookups in one request, such as first: user(id: "1") and second: user(id: "2"). The server still resolves each aliased field separately, so cost grows with every alias.

Practice. Write one query that fetches two different users by ID with aliases and prints both names.

Variables Core

Variables separate a query's text from the values that change. You declare them in the operation header with types, use them with a dollar sign, and send their values in a separate JSON map.

query Product($id: ID!, $withReviews: Boolean = false) {
  product(id: $id) {
    name
    reviews @include(if: $withReviews) { rating }
  }
}

The variables travel as {"id": "42"}. This stops injection through string concatenation, lets servers cache parsed queries, and lets clients reuse one document with many values.

Variable types must be compatible with where they are used: a nullable variable cannot feed a non-null argument without a default. Variables can be input objects and lists. Never splice user input into the query string.

Practice. Convert a query with a hard-coded ID into one that takes the ID as a variable with a non-null type.

Fragments Core

A fragment is a reusable set of fields on a given type. You define it once and spread it wherever needed.

fragment UserCard on User {
  id
  name
  avatarUrl
}
query { me { ...UserCard } post(id: "1") { author { ...UserCard } } }

Fragments cut duplication and, more importantly, let a UI component own the data it needs. Relay and Apollo Client both encourage colocating a fragment with the component that renders it, so adding a field to a component never touches a parent query.

Inline fragments, written ... on Type { }, select fields that exist only on one member of an interface or union. Fragments must not form cycles, and spreads on a type that cannot occur at that position fail validation.

Practice. Extract a repeated group of fields into a named fragment and use it in two places.

Directives Recommended

Directives attach behaviour to fields, fragments or operations using an at sign. Two come with every server: @include(if: Boolean) and @skip(if: Boolean), which add or omit a field depending on a variable. A third, @deprecated, marks schema fields and enum values as retired, and @specifiedBy points a custom scalar at its definition.

Servers can define their own directives. Common uses are authorisation hints, cache control, field formatting and federation metadata. Schema directives run when the schema is built or when a field resolves, and executable directives appear in client queries.

Directives are powerful but hide behaviour, so document each one. Treat a custom directive as part of your public contract. Also be aware that stream and defer, covered later, are directives on the client side.

Practice. Use a variable with the include directive to toggle one field, then mark a schema field as deprecated with a reason.

Stage 3 Mutations and Real-Time

Intermediate1-2 weeks7 topics

Goal. Design safe writes and choose a suitable way to deliver live updates.

What are Mutations Core

Mutations are the write operations. Anything that creates, changes or deletes data belongs on the Mutation root type. Technically a query could change data, but by convention and by the way servers schedule work, only mutations should.

A good mutation does three things: takes one input, performs one meaningful action, and returns enough to update the client. Returning the changed object lets clients refresh their cache without a second query.

mutation AddItem($input: AddItemInput!) {
  addItem(input: $input) {
    cart { id total }
    userErrors { field message }
  }
}

Name mutations after business actions (placeOrder) rather than table operations (insertOrderRow). Prefer a single input object so the schema can grow without breaking callers.

Practice. Define a mutation with an input type and a payload type, and write the request that calls it.

Mutations Core

Beyond naming, three details separate good mutation design from bad.

  • Payload types: return a dedicated object such as AddItemPayload instead of a bare value, so you can add fields later without a breaking change.
  • Errors: expected failures (invalid input, out of stock) are better modelled as typed fields or union members than as exceptions, so clients handle them in normal code.
  • Idempotency: networks retry. Accept a client-generated key for operations such as payments, so a retried call does not charge twice.

Validate on the server whatever the client sends, and apply authorisation inside the mutation, not only in the schema. Think about which fields the mutation changes so that client caches update correctly. If the result includes an object with an ID, normalised caches refresh it automatically.

A request may hold multiple mutation fields. They run serially in the written order, with no transaction across them, so put work that must succeed together inside one mutation.

Practice. Add a union result to a mutation so it returns either the updated object or a typed validation error.

What are Subscriptions Core

Subscriptions let a client receive a stream of results over time. The client sends a subscription operation, the server keeps the connection open, and each time a matching event occurs the server runs the selection set and pushes a result.

subscription OnMessage($room: ID!) {
  messageAdded(room: $room) { id text author { name } }
}

Use them for chat, notifications, live scores or dashboards, where the server knows when data changes and polling would waste requests. A subscription has exactly one root field.

They are stateful, so they cost more than queries: connections must be held, authenticated and scaled. For occasional updates, polling or refetching after a mutation is often simpler and good enough.

Practice. List three features in an app where a subscription would help and three where polling is fine.

Subscriptions Core

On the server, a subscription field has two parts: a source that produces events, and a resolver that shapes each event into the response type. In graphql-js terms the source is an async iterable. When you publish an event, every subscriber's iterator yields and execution runs for that subscriber.

Transport is a separate decision. GraphQL itself does not say how to carry the stream. The common options are WebSocket with the graphql-ws protocol and server-sent events, covered below.

Practical concerns: authenticate when the connection opens, re-check permission per event if rights can change, handle reconnects and missed events on the client, and clean up iterators when clients disconnect. Do not leak listeners.

Practice. Build a tiny counter subscription that emits a number every second and confirm it stops when the client disconnects.

Event-Based Subscriptions Recommended

Most real systems drive subscriptions from events, not timers. A mutation or a background job publishes to a topic, and subscribed clients receive an update. An in-process publish and subscribe helper is fine for one server. With several server instances you need a shared broker, such as Redis, a message queue or a database notification channel, so an event raised on one machine reaches clients connected to another.

Keep event payloads small, such as an ID and a type, and let the subscription resolver load the full data. That way authorisation and field selection happen at delivery time and the client gets exactly what it asked for.

Filtering matters. Subscribe by topic, such as one room or one order, and not to everything. See Redis Roadmap for a broker commonly used here.

Practice. Publish an event from a mutation and receive it in a subscription, filtered to one topic.

Realtime Recommended

Realtime features come in a few shapes, and you should pick the lightest that works.

  • Polling: re-run a query every N seconds. Simple, cacheable, wasteful at scale.
  • Subscriptions over WebSocket or server-sent events: the server pushes events.
  • Refetch on event: a subscription tells the client something changed, and the client re-runs a query.
  • Incremental delivery of one response through the defer and stream directives, which is about a slow response arriving in pieces, not about new events.

Decide by update frequency, number of clients and whether you need two-way messaging. Remember that mobile clients lose connections, so handle reconnection and resynchronise state when a client comes back. Always load the current state with a query, then apply a stream of changes on top.

Live queries re-send a whole query result whenever data changes. They are not in the specification and need server-side invalidation tracking, so most teams prefer subscriptions plus a normal query.

Practice. For a live order tracker, choose a mechanism, justify it in three sentences and list what happens on reconnect.

Defer & Stream Directives Optional

@defer and @stream allow a server to send one response in several parts. With defer, the client marks a fragment as less important: the fast fields arrive first, and the slow fragment follows later in the same response. With stream, a list is delivered item by item, starting with the first few.

query {
  product(id: "1") {
    name
    ... @defer { recommendations { name } }
    reviews @stream(initialCount: 2) { text }
  }
}

The transport is a multipart HTTP response or similar. This feature has been through several revisions of its wire format and is not final in every library. Check your server and client versions before relying on it.

The benefit is a faster first paint when one resolver is slow. The cost is more complex client handling.

Practice. Read your server documentation and write down whether it supports incremental delivery and in which format.

Stage 4 Schema and Type System

Intermediate2 weeks9 topics

Goal. Design a schema with the full set of GraphQL types, written in schema definition language.

Schema Core

The schema is the contract between server and clients. It lists every type, every field on each type, and the root fields clients may start from. Most teams write it in schema definition language (SDL), a compact text format.

type Query {
  book(id: ID!): Book
  books(first: Int = 10): [Book!]!
}
type Book {
  id: ID!
  title: String!
  author: Author!
}

Two styles exist. Schema-first starts with SDL and implements resolvers for it. Code-first builds the schema from code, using classes or builder functions, and prints SDL as output. Either works; what matters is that the schema is reviewed like any public API.

Because the schema is introspectable, tools can download it to power documentation, autocomplete and code generation.

Practice. Write SDL for a small library domain with three types and one query, and load it into a server of your choice.

Type System Core

GraphQL is strongly typed. Every field has a type, and the server checks queries against those types before running anything. The type system has a small set of building blocks: scalars, objects, interfaces, unions, enums, input objects and lists, plus the non-null modifier.

Nullability deserves care. Types are nullable by default; a trailing ! means a value is guaranteed. If a non-null field fails to resolve, the null spreads to the nearest nullable parent, so over-using ! can blank out large parts of a response. A common rule is to mark IDs and truly required fields as non-null, and leave fields that call fragile services nullable.

Input types are separate from output types: an input object cannot have fields that return objects or interfaces. This keeps arguments simple data.

Practice. Review a schema and decide for each field whether it should be nullable, writing one sentence of reasoning per decision.

Scalars Core

Scalars are the leaf values of a query. The built-in ones are Int (32-bit signed), Float, String, Boolean and ID. An ID is serialised as a string and signals an opaque identifier, not text to display.

Real APIs need more, such as dates, URLs, decimals and big integers. You add custom scalars:

scalar DateTime
scalar URL

Declare them in the schema and give each one code that converts between internal and wire values. Name them for meaning, not representation, and describe the format, for example ISO 8601 for dates. Use a @specifiedBy directive to link a format specification.

Avoid a catch-all JSON scalar for convenience. It bypasses the type system, hides structure from tools and makes validation and evolution painful.

Practice. Add a DateTime custom scalar to a schema and return it from one field as an ISO 8601 string.

Scalar Coercion Recommended

Coercion is how values are converted at the boundary. Input coercion turns what the client sent, from a literal in the query or from variables, into the internal value your resolver receives. Result coercion turns what your resolver returns into the value placed in the response.

For built-ins the rules are strict. An Int field given 3.5 is rejected, and an ID accepts strings and integers but is always output as a string. If a resolver returns a value that cannot be coerced, such as a string for an Int, the field becomes null with an error.

For custom scalars you write the functions: one to serialise results, one to parse variable values and one to parse literals in the query text. Keep them strict and give clear error messages, so invalid dates fail at the edge and not deep in your code.

Practice. Write a custom scalar for an email address that rejects invalid input and test it with a good and a bad variable.

Objects Core

Object types are the main building blocks. An object type has a name and a set of fields, and each field has a type and optional arguments. The fields are the only way clients can see an object, so what you put on it is your product surface.

Practical design tips:

  • Give each object a stable id so caches can normalise it.
  • Model relationships as fields that return other objects, not as foreign key IDs.
  • Do not copy your database columns. Expose what clients need, with names that fit the domain.
  • Prefer small objects with focused fields over giant ones.

Fields on an object are resolved independently, so a field like fullName can be computed from stored values, and orders can call another service. The schema does not reveal which.

Practice. Design an Order object type with relationships to a customer and line items and say which fields need arguments.

Lists Core

A list is written with square brackets: [Product]. Nullability applies at two levels, and the combinations mean different things.

  • [Product]: the list may be null and items may be null.
  • [Product!]: the list may be null, items may not.
  • [Product]!: the list is always present, but an item may be null.
  • [Product!]!: the list is always present and every item is real.

For most fields [Product!]! is the right default: an empty list means no results, not a failure. Return an empty list rather than null for no matches.

Unbounded lists are a risk. A field returning every order a customer ever made can grow without limit. Add pagination early, since changing a list field into a paginated one later is a breaking change.

Practice. Write four versions of a list field with different nullability and explain what a client can assume from each.

Enums Core

An enum is a fixed set of named values, such as PENDING, PAID and SHIPPED. They give clients a closed vocabulary that tools can validate and autocomplete.

enum OrderStatus { PENDING PAID SHIPPED CANCELLED }

Enums serialise as their names, so the wire shows "SHIPPED". Internally a server may map each name to a number or string of its own choosing.

Adding a value to an enum can break clients that switch exhaustively, so treat a new value as a risk for output enums and make client code handle unknown values safely. Removing a value is breaking. Use @deprecated to retire values. For lists that change often, such as country codes, a type with data rows is a better fit than an enum.

Practice. Define an enum for order status and write client code that handles an unknown value without crashing.

Interfaces Recommended

An interface declares fields that several object types share. Types that implement it must provide those fields with compatible types. Queries can then select the shared fields without knowing the concrete type.

interface Node { id: ID! }
type User implements Node { id: ID! name: String! }
type Post implements Node { id: ID! title: String! }

To read fields that belong to one implementation, use an inline fragment: ... on User { name }. The special field __typename tells you which concrete type came back, and clients rely on it to pick behaviour and to key caches.

Use interfaces when types genuinely share behaviour, such as Node, Timestamped or SearchResult. Do not use them as a way to reduce typing. Interfaces can implement other interfaces.

Practice. Create a Node interface and two implementing types, then write a query that reads type-specific fields with inline fragments.

Unions Recommended

A union says that a field returns one of several object types that need not share any fields.

union SearchResult = User | Post | Product
type Query { search(text: String!): [SearchResult!]! }

Because members share nothing, you must use fragments to select fields, with __typename to tell them apart. Union members must be object types, not interfaces or scalars.

Unions are the cleanest way to model results that can be success or typed failure, such as CreateUserResult = User | EmailTaken | InvalidInput. The client handles each case explicitly and the type system documents it.

Choose an interface when types share fields and a union when they do not. A union can later gain members, which is a soft-breaking change for clients that do not handle unknown types.

Practice. Model a login mutation result as a union of success and at least two typed failures, and query it.

Stage 5 Execution and Resolvers

Intermediate2 weeks7 topics

Goal. Explain how a query becomes a result and write resolvers that perform well.

Validation Core

Before any code runs, the server validates the query document against the schema. Validation is static: it needs only the schema and the text, not data. It rejects unknown fields, missing selection sets, wrong argument types, undefined variables, unused fragments, fragment cycles and fields that conflict.

Invalid queries return errors and never reach a resolver. That means a typo cannot trigger side effects, and it means tools can validate queries in your editor or CI against the schema file.

You can add rules. Common extra rules limit depth, count aliases, restrict introspection and cap the estimated cost of a query. These are central to securing a public API, covered in a later stage. In an interview, remember the order: parse, validate, execute.

Practice. Send three broken queries (unknown field, missing selection, wrong argument type) and note each error message.

Execution Core

Execution turns a validated query and the schema into a result. The engine starts at the root type, runs the resolver for each requested field, and for object results moves down into the selection set.

Rules worth knowing:

  • Sibling fields of a query can be resolved in parallel; mutation root fields run in order.
  • A resolver returns a value, a promise of one, or an error.
  • If a field's type is a list, the engine applies the sub-selection to each item.
  • If a non-null field errors, null propagates up to the nearest nullable ancestor.
  • Errors are collected, and execution continues for other fields where possible.

Execution is breadth-wise by level in practice. Understanding this explains why N+1 problems appear: each parent in a list triggers its own child resolver call.

Producing the result is the final step: values from resolvers are coerced to their types and gathered into an ordered map that mirrors the query, with errors listed beside it, each carrying a path to the failing field. Partial results are normal, so clients read both data and errors.

Practice. Trace a three-level query by hand, writing the order in which resolvers would be called for a list of two items.

Resolvers Core

A resolver is a function that supplies the value for one field. It receives four things: the parent object, the arguments, a context object shared by the whole request, and information about the query.

const resolvers = {
  Query: { book: (_, { id }, ctx) => ctx.db.books.find(id) },
  Book:  { author: (book, _, ctx) => ctx.db.authors.find(book.authorId) },
};

Fields with no resolver use a default that reads a property with the same name from the parent. Keep resolvers thin: they should call a service or data access layer, not hold business logic. Put per-request things such as the signed-in user and data loaders in the context.

Never share mutable state between requests. Create the context fresh for each request.

Practice. Write resolvers for a Book and Author schema, with the author resolved from the parent book.

Asynchronous Core

Most resolvers wait on something: a database, another service, a file. In JavaScript they return promises, and the engine waits for each field before completing it. In Java it may be a CompletableFuture, in Python an awaitable, and in Go a goroutine-friendly function.

Siblings run concurrently, so one slow field does not block fast ones, but the response is only sent when the slowest field finishes. That is the motivation for incremental delivery.

Rules of thumb: never block the event loop in a Node server, set timeouts on downstream calls, and make sure a failing call produces an error for that field and not a hung request. Prefer fetching related data in batches, not once per item.

Synchronous resolvers, which only read a property or reshape data already in memory, can sit beside asynchronous ones in the same selection set. Keep them cheap, because heavy synchronous work blocks the thread.

Practice. Add an artificial one-second delay to one resolver and measure the total response time with and without a sibling field.

Batching Core

The N+1 problem is the classic GraphQL performance trap. A query asks for 50 posts and each post's author. The posts resolver runs one query, then the author resolver runs 50 times, one per post.

The usual fix is a data loader: a small per-request helper that collects the keys requested in the same tick, makes one batched call such as WHERE id IN (...), and hands each caller its own result. It also caches within the request, so a repeated key costs nothing.

const authors = new DataLoader(async (ids) => {
  const rows = await db.authors.findMany(ids);
  return ids.map(id => rows.find(r => r.id === id));
});

Create loaders per request, never globally, or you will leak data between users. Results must come back in the same order as the keys. Other fixes include joins or look-ahead on the selection set. See SQL Roadmap for query tuning.

Practice. Reproduce an N+1 in a toy server, count database calls, then fix it with a loader and count again.

Caching Core

Caching is harder than with resource URLs, because a single POST endpoint gives HTTP caches little to key on. You cache at several layers instead.

  • Client: normalised caches such as Apollo Client and Relay store objects by type and ID, so one update refreshes every screen showing that object.
  • Server per request: data loaders remove duplicate loads.
  • Server across requests: cache expensive lookups in Redis or memory, keyed by what the lookup needs.
  • Response level: cache whole results with hints on how long each field stays valid.
  • HTTP: persisted queries sent by GET with a hash allow CDN caching of public data.

Decide per field how fresh data must be, and invalidate on writes. Never cache a response that depends on the user without including identity in the key. See Redis Roadmap.

Practice. Pick one slow public query, add a cache with a time limit and measure the difference in latency.

Pagination Core

Any list that can grow needs pagination. Two common schemes exist.

Offset pagination takes limit and offset. It is simple, but items shift when data changes, and large offsets are slow in databases.

Cursor pagination returns an opaque cursor for each item and accepts first and after. It is stable under inserts and is what most client libraries expect. The widely used Relay connection shape looks like this:

type PostConnection {
  edges: [PostEdge!]!
  pageInfo: PageInfo!
}
type PostEdge { cursor: String! node: Post! }
type PageInfo { hasNextPage: Boolean! endCursor: String }

Make the cursor opaque, for example an encoded sort key, so you can change the internals. Cap first on the server. Sort on an indexed, unique column to get deterministic pages.

Practice. Implement cursor pagination for a list over a database table and test it while inserting rows between pages.

Stage 6 Serving GraphQL and Securing It

Intermediate2 weeks6 topics

Goal. Serve GraphQL over HTTP and WebSockets, authenticate clients and defend against abusive queries.

GraphQL HTTP Core

In practice most GraphQL traffic is HTTP. The client sends a request to one URL, usually /graphql, and gets JSON back. A POST request carries a JSON body with query, optional operationName and optional variables.

POST /graphql
{"query": "query($id: ID!){ user(id:$id){ name } }", "variables": {"id": "7"}}

GET is allowed for queries only and is useful for caching and persisted queries. Mutations must never be accepted over GET, because links and prefetchers could trigger them.

Know the difference between transport and language: GraphQL does not require HTTP, but HTTP is the default. Use HTTPS, set sensible body size limits, and apply the same middleware you use elsewhere for logging, CORS and rate limiting.

Practice. Call a GraphQL server with curl using POST and then with GET, and note what each accepts.

GraphQL Over HTTP Spec Recommended

A separate specification describes exactly how GraphQL should travel over HTTP, so clients and servers from different vendors agree. It defines the request parameters, the media types, and how status codes relate to results.

The newer response media type is application/graphql-response+json. With it, a request that fails before execution, such as a syntax error or failed validation, can return a 4xx status, while a request that executed returns 200 even if it contains field errors. Servers that use the older application/json type often return 200 for everything, which hides failures from monitoring.

Clients should send an Accept header and be ready for either. If you run an API gateway, check how it treats the status codes, since alerts based on them behave differently under each media type.

The graphql-http library is a small reference handler for this specification and ships an audit suite for checking other servers.

Practice. Send a query with an unknown field and compare the status code under both response media types if your server supports both.

Serving over Internet Core

Moving a GraphQL server from your laptop to the internet changes the questions you must answer.

  • Terminate TLS and serve only over HTTPS and secure WebSocket.
  • Set CORS rules to the origins that need access, not a wildcard when cookies are used.
  • Put a limit on request body size, timeouts on execution and a cap on concurrent requests.
  • Run behind a proxy or gateway that can rate limit by client.
  • Decide whether introspection and the browser playground are open in production.
  • Return generic messages for internal errors and log the details with a request ID.

Add health checks and graceful shutdown so open subscriptions end cleanly. Keep the schema file in version control so you can compare it between releases. See Docker Roadmap and Kubernetes Roadmap for packaging and running the service.

Practice. Write a deployment checklist for a GraphQL service with at least eight items.

Authorisation in GraphQL Over HTTP Core

Separate authentication (who is calling) from authorisation (what they may do). Authenticate once per HTTP request, in middleware, from a header such as a bearer token or a session cookie. Put the verified user in the context.

Then enforce rules where the data is, not at the edge only. Options:

  • In resolvers, by checking the context user before returning data.
  • In the business layer, so every path to the data is covered, including other transports.
  • With directives such as a role check on a field, which are visible in the schema.

Check object-level rules, not just roles: a customer may read their own orders, not everyone's. Because clients choose fields, a sensitive field must be protected on every parent that exposes it. Treat nulls and errors for denied fields consistently so that responses do not leak whether a record exists.

Practice. Protect an orders field so users see only their own orders and write a test that proves another user gets nothing.

Authorisation in GraphQL Over WebSockets Recommended

Browsers cannot set custom headers on a WebSocket handshake, so token handling differs from plain HTTP. The common approach with the graphql-ws protocol is to send credentials in the connection_init message, verify them when the connection starts and store the user for that connection.

Points to get right:

  • Reject the connection if the token is missing or invalid.
  • Expect long-lived connections: tokens may expire while the socket is open, so decide whether to close, refresh or re-check on each event.
  • Check permissions per subscription and per event if access can change.
  • Never put tokens in the URL query string, since URLs end up in logs.

Limit how many subscriptions a client can hold and time out idle connections.

For server-sent events the same rules apply as plain HTTP, so a header or cookie is checked before the stream opens and this is GraphQL Over SSE Authorization in practice; use a fetch-based client when you need a bearer token, and expect long streams to outlive short tokens.

Practice. Implement connection_init token checking for a subscription server and test with a missing token.

Query Security and Limits Core

A flexible query language needs guard rails. A client can ask for deeply nested or very wide data, or send thousands of aliased calls in one request.

Layer these defences:

  • Depth limit: reject queries nested beyond a set level.
  • Cost analysis: give fields weights, multiply by list sizes, reject over budget.
  • Pagination caps: refuse first: 100000.
  • Alias and directive count limits.
  • Timeouts and cancellation for long resolvers.
  • Persisted queries: allow only known operations for first-party apps.
  • Rate limiting by cost, not just by request.
  • Disable introspection and suggestions for private production APIs.

Also validate inputs, escape values used in database queries and never trust client-chosen sort fields. Security is a frequent senior interview topic, so be ready to explain each defence and its trade-off.

Practice. Add a depth limit and a cost limit to a server and write one query that each blocks.

Stage 7 GraphQL on the Backend

Intermediate2-3 weeks6 topics

Goal. Build a working GraphQL server in at least one language and understand the choices in others.

GraphQL on the Backend Core

GraphQL on the Backend means choosing a library, deciding how the schema is authored and layering the code well. A typical layout has the schema and resolvers at the top, a service layer with business rules below, and data access at the bottom. Resolvers should be thin adapters.

Decisions to make early:

  • Schema-first or code-first.
  • How context is built, including the user and data loaders.
  • Where errors are translated into the response.
  • How to test: execute queries directly against the schema in tests, without HTTP.
  • Whether you need a gateway or just one service.

A GraphQL layer can sit in front of a database, other REST services, or both. Start with one service. Introduce federation only when separate teams really need to own parts of the graph. See Node.js Roadmap for the runtime used in many examples.

Practice. Draw the layers of a GraphQL service for a domain you know and mark where each decision above is made.

GraphQL.js Core

GraphQL.js is the reference implementation in JavaScript. It exposes functions to build a schema, parse, validate and execute queries, and almost every JavaScript server is built on it. Knowing it explains what higher-level servers do.

import { buildSchema, graphql } from 'graphql';
const schema = buildSchema('type Query { hello: String }');
const rootValue = { hello: () => 'world' };
const result = await graphql({ schema, source: '{ hello }', rootValue });

It does not include an HTTP server, which is why you pair it with a framework or a server library. It also provides the type classes for building schemas in code, the introspection query and utilities such as printing a schema to SDL.

Use it directly in tests and tools. For apps, use a server library that adds plugins, subscriptions and tooling.

Practice. Run a query against a schema built with buildSchema, without any HTTP server.

Apollo Server Core

Apollo Server is a widely used GraphQL server for Node. You give it type definitions and resolvers, and it handles parsing, validation, execution, error formatting and plugins. It can run standalone or inside a framework such as Express through middleware.

const server = new ApolloServer({ typeDefs, resolvers });
const { url } = await startStandaloneServer(server, {
  context: async ({ req }) => ({ user: await auth(req) }),
});

Features include plugins for tracing and caching hints, a landing page for exploring the API, persisted queries and integration with federation. Major versions have removed built-in framework integrations and older features, so follow the current documentation, and note that old tutorials with apollo-server-express setups may be outdated.

Be ready to explain context, plugins and error handling in an interview.

Practice. Build an Apollo Server with one query and one mutation, with a context function that reads an auth header.

GraphQL Yoga Recommended

GraphQL Yoga is a server from The Guild that runs on the Fetch API, so it works on Node, Deno, Bun, Cloudflare Workers and other runtimes with the same code. It follows the GraphQL over HTTP specification closely and supports subscriptions over server-sent events out of the box.

It is built on a plugin system. Plugins add features such as response caching, persisted operations, depth limiting and tracing. It pairs well with schema builders and with the wider ecosystem from the same maintainers, including code generation tools.

Choose it when you want a lightweight, standards-aligned server, edge deployment or easy SSE subscriptions. Compare it with Apollo Server on ecosystem, defaults and federation support, and be able to justify your choice.

Mercurius is the equivalent plugin for the Fastify framework, with query compilation, built-in loaders and federation support.

Practice. Run the same schema on Yoga and on Apollo Server and note three differences in setup and features.

Graphene Recommended

Graphene is a library for building GraphQL servers in Python. It is code-first: you define types as Python classes and the library generates the schema. Integrations exist for Django and SQLAlchemy, and it works with several web frameworks.

class Query(graphene.ObjectType):
    hello = graphene.String(name=graphene.String(default_value="world"))
    def resolve_hello(root, info, name):
        return f"Hello {name}"

Python has other options, including libraries that use type annotations and dataclasses to define the schema, so compare them before choosing. In any Python server, be careful with N+1 queries from an ORM and use data loaders or query optimisation. See Python Roadmap and Django Roadmap.

Practice. Define a Graphene type with a resolver and run it through a test client.

GraphQL Java Recommended

GraphQL Java is the main Java implementation. You build a schema from SDL by wiring each field to a data fetcher, which is Java's name for a resolver, and then execute queries through a GraphQL object. Asynchronous execution uses CompletableFuture.

Spring for GraphQL builds on it. You write annotated controller methods, and the framework maps them to schema fields, supports batching with a mapping annotation, and integrates with Spring Security and the web stack. The result feels natural in an existing Spring Boot service.

Things to know: schema-first with SDL files is the norm, instrumentation hooks provide tracing and limits, and a data loader registry handles batching. See Java Roadmap and Spring Boot Roadmap.

In Go, gqlgen generates typed resolver signatures from your SDL, which catches mismatches at compile time. Other GraphQL Go libraries build the schema in code at runtime. See Go Roadmap.

Practice. Expose a book query in a Spring Boot service using a controller method mapped to the schema.

Stage 8 GraphQL on the Frontend

Intermediate2 weeks4 topics

Goal. Consume a GraphQL API from a client app with caching, typed code and good UX states.

GraphQL on the Frontend Core

On the client, a GraphQL library sends operations, caches results and keeps your UI in sync. You can call an API with plain fetch, but a client library gives you caching, loading and error states, and updates after mutations.

What good client code looks like:

  • Each component declares the fields it needs, often with a fragment.
  • Generated types describe results and variables, so mistakes appear at compile time.
  • Loading, empty, error and partial-data states all have designs.
  • Writes update the cache from the mutation result, or invalidate and refetch.

Code generation reads the schema and your documents and produces typed hooks or functions. It removes a class of bugs and is worth setting up early. See React Roadmap and TypeScript Roadmap.

Practice. Fetch from a GraphQL API with plain fetch, then rewrite it with a client library and compare what you gained.

Apollo Client Core

Apollo Client is the most common GraphQL client for React and other frameworks. It provides hooks such as useQuery and useMutation, and a normalised in-memory cache that stores objects by type name and ID.

const { data, loading, error } = useQuery(GET_USER, { variables: { id } });

Important ideas: fetch policies decide whether to read from cache, network or both; type policies configure keys and pagination merging; optimistic responses update the UI before the server answers; and refetching or cache updates keep lists correct after writes.

Common mistakes include missing id fields in selections, which breaks normalisation, and forgetting to merge paginated results. Know how to read the cache and how to reset it on logout.

Practice. Build a list and detail screen with Apollo Client and an optimistic mutation that toggles a flag.

Relay Recommended

Relay is a GraphQL client from Meta built around strict conventions that make large apps predictable. It uses a compiler: you write fragments next to components, and the compiler generates artefacts and types. Components declare their data needs and parents never need to know them.

It expects the server to follow certain patterns: global object identification through a Node interface and cursor connections for pagination. In return you get efficient fetching, fine-grained re-rendering and strong guarantees about data masking.

The learning curve is steeper than other clients. Choose it for big teams with many screens and when you control the schema. Even if you never use it, the ideas of colocated fragments, connections and global IDs are asked about in interviews.

Practice. Write a fragment colocated with a component and explain what data masking means for the parent.

URQL Recommended

URQL is a lighter GraphQL client with a small core and an extensible pipeline of exchanges. By default it uses a document cache keyed by query and variables, which is simple to reason about. A normalised cache is available as an optional exchange when you need object-level updates.

Exchanges handle deduplication, caching, retries, authentication and subscriptions, so you add only what you need. It has bindings for React, Vue, Svelte and others.

Compare it with Apollo Client: URQL starts simpler and smaller, while Apollo offers a larger feature set and ecosystem. Know the difference between a document cache, which invalidates by type, and a normalised cache, which updates entities, since the trade-off is a common interview question.

Practice. Add an authentication exchange to a URQL client that attaches a token and refreshes it on a 401.

Stage 9 Scaling and Production

Advanced2 weeks3 topics

Goal. Evolve a schema safely, split it across teams and operate it in production.

Federation Recommended

Federation lets several teams own separate GraphQL services (subgraphs) that a router combines into one supergraph. Each subgraph defines part of the schema and may extend types owned by others, such as a Reviews service adding a reviews field to a Product defined elsewhere.

The router plans each query, calls the subgraphs it needs, and merges results. Entities are the shared types, identified by key fields, and each subgraph supplies a way to resolve an entity from its key.

It solves organisational scaling, not performance. It adds a network hop, schema composition checks and operational work. Use it when several teams must evolve one graph independently. For one team, a single service is simpler.

Practice. Explain, with one example, how a second subgraph adds a field to an entity it does not own.

Schema Evolution Core

GraphQL APIs usually evolve without version numbers. Additive changes are safe: new fields, new types, new optional arguments. Breaking changes are removals, renames, tightening nullability on inputs, loosening it on outputs and new required arguments.

The workflow: add the new field, mark the old one with @deprecated and a reason, measure which clients still use it from operation logs, tell their owners, and remove it after usage drops to zero.

Run schema diff checks in CI to flag breaking changes against registered client operations. Naming matters: you cannot rename cheaply, so choose names carefully before release. Treat unknown enum values and union members as something clients must tolerate.

Practice. Deprecate a field in a sample schema and write a CI step description that fails on removing a used field.

Testing and Observability Recommended

Test at three levels. Unit tests cover resolvers and services. Schema-level tests execute queries directly against the schema with a test context, which is fast and needs no network. A few end-to-end tests cover transport, authentication and error format.

For observability, remember that every request hits one URL, so URL-based metrics are not useful. Instead record the operation name, duration, error count and, if possible, per-field timing. Distributed tracing shows which resolver calls which service. Log request IDs and redact variables that hold personal data.

Alert on error rate by operation, slow operations and rising query cost. Track which client versions use which fields before removing anything.

Practice. Write a schema-level test that runs a query with a fake context and asserts both data and errors.

Projects to build

Build these in order. Each one should end up in a public repository with a short README that explains your decisions.

  1. Books and authors APIBeginner

    Build a small server with books and authors, queries with arguments, and a mutation to add a book. Seed the data in memory and use the playground to explore it.

    SDL · Resolvers · Arguments · Mutations

  2. Blog backend with a databaseIntermediate

    Add users, posts and comments backed by a database. Use cursor pagination for posts, a data loader for authors and a test that proves the author query runs once for a page of posts.

    Pagination · Data loaders · Context · Testing

  3. Authenticated notes serviceIntermediate

    Add sign-in with tokens, per-user notes and field-level permissions. Return typed errors from mutations through a union and write tests for every denied case.

    Authorisation · Unions · Error handling · Context

  4. Live chat with subscriptionsAdvanced

    Build rooms and messages with a subscription for new messages. Authenticate the socket, publish events through a shared broker, and handle reconnection on the client.

    Subscriptions · WebSocket auth · Event-based design · Redis

  5. Typed client appAdvanced

    Write a React app for the chat or blog API using Apollo Client or URQL with generated types, optimistic updates and fragment colocation. Add depth and cost limits on the server and a script that checks for breaking schema changes.

    Client caching · Code generation · Query limits · Schema checks

Interview questions

Try to answer each question out loud before you open the answer.

What is GraphQL and how does it differ from REST?Junior

GraphQL is a typed query language and runtime. The client sends a query describing the fields it wants, usually to one endpoint, and gets exactly that shape back. REST exposes many resource URLs with fixed responses. GraphQL reduces over-fetching and round trips and gives a strongly typed contract. The cost is harder HTTP caching, a need for query cost controls, and more server complexity. I would choose it for varied clients and rich data relationships, and REST for simple resource APIs.

What are the three operation types?Junior

Query reads data, mutation writes data and subscription streams events over time. Queries may run their root fields in parallel. Mutation root fields run one after another, in the order written. A subscription has a single root field and delivers a result each time an event occurs. All three start at root types in the schema.

Why would you use variables instead of putting values in the query string?Junior

Variables keep the query text constant and send values separately as typed JSON. That prevents injection through string building, lets servers cache parsed documents and lets clients reuse one operation. The types are checked against the schema, so an invalid value is rejected before execution. Persisted queries also depend on the text being fixed.

How does nullability work, and how do you decide what is non-null?Mid

Fields are nullable by default and a trailing exclamation mark makes them non-null. If a non-null field fails, null moves up to the nearest nullable parent, which can wipe out a large part of the response. I make fields non-null when they are truly guaranteed, such as IDs, and keep fields that call fragile services nullable. Input arguments are the opposite: be strict about required inputs.

What is the N+1 problem and how do you fix it?Mid

When a list of N items each has a child field resolved separately, the server runs one query for the list and N more for the children. I fix it with a data loader, which collects keys requested in the same tick and loads them in one batched call, with per-request caching. Alternatives are joins, or looking at the selection set to prefetch. Loaders must be created per request.

Explain cursor pagination and why it beats offset pagination.Mid

Cursor pagination returns an opaque marker for each item and asks for items after a cursor. It stays correct when rows are inserted or deleted between pages and uses an indexed sort key, so it remains fast on deep pages. Offset pagination skips rows by count, so pages shift as data changes and large offsets cost more. The connection shape with edges, nodes and page info is the common convention.

How would you cache GraphQL responses?Mid

At several levels. Client libraries normalise objects by type and ID. The server uses per-request data loaders and shared caches for expensive lookups. For public data, persisted queries over GET let a CDN cache by URL. For whole responses, add cache hints per field and take the shortest lifetime. Anything user-specific must include identity in the key. Invalidate on writes.

How do you secure a public GraphQL endpoint?Senior

Authenticate in middleware and put the user in context. Authorise in the business layer or resolvers, including object-level checks. Limit query depth and cost, cap page sizes, set timeouts and rate limit by cost. Use persisted queries for first-party clients. Validate inputs, hide internals in errors and consider turning introspection off for private APIs.

What is the difference between schema-first and code-first?Mid

Schema-first starts with SDL as the source of truth and you write resolvers for it. It is readable by every team and works well with code generation. Code-first defines the schema using code, so types and resolvers stay in one place with the language's tooling, and SDL is generated. Either is fine. What matters is review of the schema as a public contract.

How do you handle errors in GraphQL?Mid

Unexpected failures go to the top-level errors array with a path and a code in extensions. Expected failures such as validation problems are modelled in the schema, usually as union results or fields on a mutation payload, so clients handle them as data. I never expose stack traces. Because responses can be partial, clients must handle data and errors together.

How do you evolve a GraphQL schema without versions?Senior

Make additive changes freely. For removals, deprecate with a reason, track usage per field from operation logs, contact client owners, and remove only when usage is zero. CI schema diffs catch breaking changes. Treat new enum values and union members as breaking for clients that cannot handle unknown values.

When would you use subscriptions, and what are the costs?Mid

When the server knows about changes and clients need them quickly, such as chat or live status. Costs are held connections, authentication on long-lived sockets, scaling across instances with a shared broker, and reconnection logic. For infrequent updates, polling or refetching on a mutation is simpler. For one-way streams, server-sent events can be easier to run than WebSockets.

What is federation and when is it worth it?Senior

Federation lets teams own subgraphs that a router composes into one graph, with shared entities identified by keys. It suits large organisations where teams need independent deployment and ownership of one logical API. It adds an extra hop, composition checks and operational work, so it is not worth it for a single team, which can use one service.

What happens when a client sends a query? Walk through the steps.Mid

The server parses the text into a document, validates it against the schema, selects the operation by name, coerces variables, and executes it. Execution runs resolvers from the root, field by field, completing values, handling lists and propagating nulls on non-null errors. The result is assembled into data and errors and sent as JSON.

How would you decide between GraphQL and REST for a new project?Senior

I look at clients, data shape and team structure. Several clients with different needs, deeply related data and a front-end team that iterates quickly favour GraphQL. A simple public API, heavy HTTP caching needs, file transfer or a small team with few clients favour REST. They can coexist: a GraphQL layer can call existing REST services.

Common mistakes

  • Mirroring database tables one to one in the schema; design around client needs and the domain instead.
  • Marking everything non-null, so one failing field blanks a whole object; leave unreliable fields nullable.
  • Ignoring N+1 until production; add data loaders when you write the first nested list.
  • Returning unbounded lists; paginate from the start because adding it later is a breaking change.
  • Using a generic JSON scalar to avoid typing; model the structure so tools and validation work.
  • Putting authorisation only at the gateway or in the client; enforce it in resolvers or the business layer.
  • Sharing a data loader or its cache between requests, which leaks data between users; create loaders per request.
  • Leaving introspection, depth and cost limits open on a public endpoint; add limits before launch.
  • Building queries by string concatenation; always use variables.

Ready-for-interview checklist

  • I can write queries with arguments, aliases, variables, fragments and directives.
  • I can design a schema with enums, interfaces, unions, custom scalars and sensible nullability.
  • I can implement resolvers and explain the four arguments each receives.
  • I can spot and fix an N+1 problem with a data loader.
  • I can implement cursor pagination using the connection pattern.
  • I can design mutations with input types, payloads and typed errors.
  • I can explain how subscriptions are delivered and authenticated.
  • I can secure an endpoint with authentication, authorisation and query limits.
  • I can explain the layers of caching available to a GraphQL API.
  • I can build a server in at least one language and test it without HTTP.
  • I can use a client library with a normalised cache and generated types.
  • I can describe schema evolution, deprecation and when federation is justified.

Related roadmaps

FAQ

Should I learn REST before GraphQL?

Yes, at least the basics. GraphQL is easier to understand once you know what resources, HTTP methods and status codes do, and interviewers often ask you to compare them. A week with API Design Roadmap is enough before starting here.

How long does it take to learn GraphQL?

Writing queries takes a few days. Building a server with a database, pagination and authentication takes about a month. Federation, security and performance work take longer and come from building something real.

Is GraphQL replacing REST?

No. Many teams use both. GraphQL fits varied clients and connected data. REST remains simpler for plain resource APIs and benefits from standard HTTP caching. Knowing both is the strongest position for interviews.

Which server library should I start with?

Pick the one in the language you already know. For JavaScript, Apollo Server or GraphQL Yoga are both fine choices. The concepts of schema, resolvers, context and loaders carry across every library.

Do I need a client library, or is fetch enough?

Fetch is enough for small apps and scripts. A client library becomes worth it when you need a normalised cache, optimistic updates, pagination handling and generated types across many screens.

Practise while you learn.Solve interview problems in the browser, with hints and a timer.
CodingSQLSystem design
Next Post Previous Post
No Comment
Add Comment
comment url