GraphQL

Using Zuplo with GraphQL APIs

Yes, Zuplo supports GraphQL. Zuplo is a proxy-based API gateway, and a GraphQL API is just an HTTP endpoint — typically a single POST /graphql route. Proxy your existing GraphQL server through Zuplo, then layer on authentication, rate limiting, caching, analytics, and documentation using the same policies you use for REST, plus policies built specifically for the GraphQL request shape.

This page summarizes everything Zuplo offers for GraphQL APIs and links to each guide and policy reference.

New here?

Start with Set up an endpoint to proxy your GraphQL API through the gateway, then come back to layer on the capabilities below.

Connect and route

Proxy any GraphQL server through a POST /graphql route using the URL Rewrite handler. The Route Designer ships a GraphQL Endpoint template, and the x-graphql route extension (a boolean flag in routes.oas.json — set "x-graphql": true on the route operation) marks a route as GraphQL so the gateway and Dev Portal treat it accordingly.

Secure the endpoint

GraphQL's flexibility is also its attack surface: a single request can nest arbitrarily deep, fan out into thousands of resolver calls, or map your whole schema through introspection. Zuplo closes these gaps at the edge.

RiskWhat Zuplo does
Deep / costly queryReject queries over a depth or complexity score
Schema discoveryBlock introspection in production
Schema over-sharingStrip chosen types and fields from introspection

Authenticate and rate-limit

Because a GraphQL route is a standard Zuplo route, every general-purpose policy works on it — including authentication and rate limiting. Attach an API key auth policy or any other auth policy as an inbound policy on the POST /graphql route, then add a rate limiting policy to protect your upstream from traffic spikes. No GraphQL-specific configuration is required; these policies operate on the HTTP request before the GraphQL-specific policies run.

Accelerate with caching

A normal CDN keys on the URL, so it can't cache GraphQL queries sent as request bodies. The GraphQL cache parses each query, normalizes it into a canonical form, and serves semantically identical queries from one edge cache entry.

Observe traffic

Report GraphQL operations and their errors to analytics, even when the upstream returns errors inside a 200 response (GraphQL servers signal per-field errors in the response body rather than with HTTP status codes). The GraphQL analytics dashboard surfaces operation volume, latency, and error classes once traffic flows.

Document in the Dev Portal

The @zudoku/plugin-graphql Dev Portal plugin (an npm package included with Zudoku) renders a browsable type reference and an interactive playground in your Dev Portal, generated from your schema or a live endpoint. Register one instance per API.

Expose GraphQL to AI agents

Turn GraphQL queries into MCP tools — MCP (Model Context Protocol) is a standard that lets AI agents discover and call API operations — so AI agents can call your GraphQL API with the same policies and auth applied.

Zuplo and GraphQL federation

Zuplo is a proxy-based API gateway, not a native GraphQL federation gateway. It does not perform schema composition, query planning, or subgraph orchestration — those are the job of a dedicated federation layer such as Apollo Router or a similar tool.

When you use a federated architecture, Zuplo sits in front of your federation gateway as the public-facing entry point. Traffic flows through Zuplo first for authentication, rate limiting, and analytics, then Zuplo forwards the request to Apollo Router (or your federation tool of choice), which resolves the query across your subgraphs. This layered pattern gives you edge-level security and observability without interfering with the federation layer's query planning.

Request flow with federation
Client → Zuplo (auth, rate limit, analytics) → Apollo Router → Subgraphs

If your GraphQL API is a single server (no federation), Zuplo connects to it directly and no federation layer is needed.

Policies at a glance

Every GraphQL-aware policy Zuplo ships, with its direction and purpose:

PolicyDirectionPurpose
graphql-cache-inboundInboundCache repeated queries at the edge
graphql-complexity-limit-inboundInboundReject queries that are too deep or too expensive
graphql-disable-introspection-inboundInboundBlock schema introspection in production
graphql-introspection-filter-outboundOutboundHide chosen types and fields from introspection
graphql-analytics-outboundOutboundReport operations and errors to analytics

Next steps

Last modified on