October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

GraphQL Didn’t Delete Your Waterfall—It Moved It

GraphQL can reduce client round trips without eliminating backend waterfalls. Learn how N+1 resolvers, federation, batching, and @defer affect performance.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A single GraphQL operation can replace several client-to-server requests, but it does not guarantee one backend call, parallel execution, or a faster complete response. Nested resolvers may repeat data loads, and a federated router may need one subgraph’s results before it can query another. The waterfall can disappear from the browser’s network panel while continuing inside the server.

To understand the difference, track three things separately: client round trips, backend or subgraph calls and their dependencies, and when the interface receives useful data. Each points to a different performance problem—and a different remedy.

As an Amazon Associate I earn from qualifying purchases.

What a GraphQL request does—and doesn’t—combine

GraphQL lets a client describe related data in one operation. That can reduce over-fetching and the number of client-server round trips, two potential benefits noted in the GraphQL FAQ. But the operation is a request shape, not a promise about how the server retrieves every field.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A server can resolve fields through separate functions, databases, services, or subgraphs. Some work can happen concurrently; other work depends on earlier results. The client may therefore see one HTTP request while the server performs many backend calls, some in sequence. Fewer network requests from the browser do not by themselves establish less total work or shorter end-to-end time.

How the N+1 problem creates a hidden waterfall

Consider a query for a list of events and each event’s venue. The server may fetch the events in one call, then invoke a venue resolver once for every event. If there are N events, that pattern can mean one initial fetch plus N venue lookups: the N+1 problem. The same pattern appears whenever resolving a nested field triggers repeated data-source work.

The GraphQL performance guide describes batching as a way to gather repeated loads over a short interval and issue them together; DataLoader is one implementation used in JavaScript. Other approaches can translate a selection set into a more efficient source query. The appropriate solution depends on the backend and resolver design.

Batching can reduce repeated calls, but it does not make every query cheap. It may not remove dependencies between different kinds of work, and a query can still request an expensive amount of data. The Apollo waterfall article illustrates resolver and batching patterns in an events application; its examples are implementation-specific, not a universal performance benchmark.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why federation can preserve serial work

In a federated graph, a router may need to fetch one subgraph’s data before it knows what to ask another. Apollo’s documented Products/Reviews query plan first fetches products, then uses product identifiers to request the related reviews. As Apollo explains, “Because the second sub-query depends on data from the first, these two sub-queries must occur serially.” See the Apollo Router @defer documentation.

This is a dependency, not necessarily a resolver bug: the review lookup cannot be formed until the product IDs exist. Combining the client’s request does not eliminate that ordering. Inspect the router’s query plan to see which fetches can run together and which must wait for earlier results.

What @defer changes—and what it leaves alone

When the server and client support incremental delivery, @defer can send ready, non-deferred data before a slower dependent field is ready. For example, a page might render product details first and append reviews when their fetch completes. This can improve time to first useful UI content even though the dependency and later work remain.

It changes when parts of a result arrive; it does not erase the underlying work or guarantee a shorter total completion time. Apollo Router’s documentation says its support requires Router v1.8.0 or newer, and the client must handle multipart HTTP responses. Confirm compatibility for the versions actually deployed rather than assuming that a directive in a query is enough.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The GraphQL Working Group’s defer/stream RFC is a working draft identified as September 2024, not a requirement that every server implement these directives. It says servers are not required to implement @defer or @stream, and describes cases where clients must tolerate a server not deferring or streaming as requested. The draft also identifies trade-offs such as added latency, client resource contention, greater server or data-layer costs, and repeated client rendering. Use incremental delivery when partial content is useful to the product and the deployed stack supports the protocol.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the fix that matches the bottleneck

Observed issue What to investigate Potential response
Many client-to-server requests before related content appears Whether independent data is being requested in separate operations Consider consolidating related data into a GraphQL operation, while checking the resulting payload and server work.
Repeated backend calls for nested fields Resolver traces and counts of data-source calls per parent item Batch repeated loads, use request-scoped loading tools, or optimize how selections map to source queries.
A later subgraph fetch waits on an earlier fetch The federated router’s query plan and the data needed to construct each fetch Treat the dependency as serial; consider incremental delivery if early fields are useful and the stack supports it.
Large payloads or repeated retrieval of unchanged data Payload size, cache behavior, and whether query requests can use supported cache-friendly methods Evaluate client caching, GET requests for queries where supported, persisted query hashes, and gzip compression.
Slow or unpredictable operations across the service Client timings, resolver and subgraph spans, backend-call counts, and query plans Monitor representative operations and apply demand controls to limit costly query shapes.

These techniques target different costs. Caching can avoid repeated retrieval; persisted query hashes and GET support can help with request handling and cacheability; compression targets transfer size; monitoring helps locate the delay. None substitutes for resolving N+1 behavior or understanding a serial dependency. The GraphQL security guidance also warns that batching does not neutralize excessive nested work or costly field combinations, so depth, breadth, batch-size, or query-cost controls may still be necessary.

How to tell whether the waterfall actually moved

  1. Measure what the user sees. Record client request timing and the arrival of the first data the interface can use, as well as when the full result is available. A faster first payload and a faster completed operation are different outcomes.
  2. Trace server work. Inspect resolver and subgraph spans, backend-call counts, and the router’s query plan. Look for repeated per-item loads and identify which fetches are dependent rather than assuming they all run in parallel.
  3. Change one relevant mechanism at a time. Apply batching to repeated loads, incremental delivery to useful partial results, or caching and compression to their respective costs. Re-measure total work and completion time as well as the initial response.
  4. Check service limits. Review whether the operation can produce expensive nested or broad work, and configure demand controls appropriate to the service. A reduced client request count is not a safeguard against resource-heavy queries.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.