Understanding GraphQL Directives: Practical Use-Cases at Zalando
Zalando uses custom GraphQL directives to declare cross-cutting server behavior in the schema and to attach client metadata in queries.
Zalando uses custom GraphQL directives to declare cross-cutting server behavior in the schema and to attach client metadata in queries.
Zalando built a context-aware "experience" mechanism so selective-distribution brands can get distinct presentation (e.g. white packshot backgrounds, hidden sale flags, restricted catalog visibility) only when a customer shows explicit intent, such as searching for the brand or opening its product page.
Zalando replaced a legacy, engineering-heavy landing page tool with a system built on the headless CMS Contentful, integrated into its Interface Framework via a Contentful proxy service behind the Fashion Store GraphQL aggregator, with modules mapped to renderers shared across web and app.
Zalando disables arbitrary GraphQL queries in production and accepts only query IDs that were persisted at build time, where an ID is a hash of the normalized query.
Zalando's Interface Framework replaces Mosaic HTML fragments with Renderers: declarative TypeScript modules that state their data needs as GraphQL queries and render a single Entity type as a React component.
GraphQL's built-in errors array is untyped and undiscoverable, so Zalando splits failures into two categories based on who can act on them.
Zalando's GraphQL server uses lookaheads on the resolver's info AST (fieldNodes and selection sets) to work out which sub-fields a query requests, then forwards them to backends that support partial responses via a fields parameter.
Zalando replaced its Mosaic micro-frontend architecture, built on team-owned page Fragments, with Interface Framework, a unified platform where pages are trees of typed Entities (Product, Collection, Outfit) mapped via declarative rendering rules to React Renderers that declare data needs in GraphQL.
Zalando replaced a sprawl of per-page and per-platform Backend-for-Frontend services with a single unified GraphQL API owned via a shared monorepo across 12+ domain teams.