---
title: "Shopify’s journey to faster breadth-first GraphQL execution"
description: "Shopify describes how high-cardinality, deeply nested GraphQL queries exposed execution overhead beyond data loading, with field resolvers assembling responses consuming much of request time. Its GraphQL Cardinal engine replaces conventional depth-first traversal with breadth-first execution, resolving each selected field once across an aggregated set of objects and reducing repeated field-level work. For large list queries, Shopify reports up to 15x faster execution, 90% less memory use, and reductions of many seconds in P50 latency. The migration included a tuned interpreter, cheaper tracer behavior, shadow verification, benchmarks, and ongoing conversion of tens of thousands of legacy resolvers, while future work includes asynchronous patterns and lower-level C bindings."
---

# Shopify’s journey to faster breadth-first GraphQL execution

[Shopify](https://yomu.fyi/company/shopify) · 2023-10-18 · Mar 12, 2026

**Type:** Explainer

## Summary

Shopify describes how high-cardinality, deeply nested GraphQL queries exposed execution overhead beyond data loading, with field resolvers assembling responses consuming much of request time. Its GraphQL Cardinal engine replaces conventional depth-first traversal with breadth-first execution, resolving each selected field once across an aggregated set of objects and reducing repeated field-level work. For large list queries, Shopify reports up to 15x faster execution, 90% less memory use, and reductions of many seconds in P50 latency. The migration included a tuned interpreter, cheaper tracer behavior, shadow verification, benchmarks, and ongoing conversion of tens of thousands of legacy resolvers, while future work includes asynchronous patterns and lower-level C bindings.

## Context

Shopify supports deeply nested GraphQL queries with dynamic breadth reaching tens or hundreds of thousands of objects. Trace analysis showed that field resolvers assembling responses often consumed more request time than I/O, while conventional depth-first execution repeated field overhead, authorization, instrumentation, and lazy promise work for every object.

## Approach / What changed

Shopify built GraphQL Cardinal, a breadth-first execution engine that resolves each field once across a set of objects. The migration also introduced a tuned interpreter, breadth-compatible tracers, resolver translation tools, a shadow verifier, benchmarks, and migration tracking for tens of thousands of legacy field implementations.

## Takeaways

- Conventional depth-first GraphQL traversal processes each object's subtree independently, so field execution and its associated overhead scale linearly with the response breadth.
- Cardinal gives field resolvers sets of objects and mapped results, making breadth batching native to the execution engine instead of layering it on depth traversal with dataloaders.
- Shopify reports up to 15x faster execution and 90% less memory for large list queries; regressions found during resolver migration have so far been attributed to translation errors.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Migrations](https://yomu.fyi/topic/migration), [Performance](https://yomu.fyi/topic/performance), [Scalability](https://yomu.fyi/topic/scalability)

- Source: [Shopify](https://shopify.engineering/faster-breadth-first-graphql-execution)
- Source URL: https://shopify.engineering/faster-breadth-first-graphql-execution
- Ingested by Yomu: 2026-08-30T13:18:14.545Z

[Read original post](https://shopify.engineering/faster-breadth-first-graphql-execution)
