REST API Orchestration With GraphQL

Matt DeBergalis
Today we are releasing Apollo Connectors, a major update that brings our declarative, graph-based orchestration technology to teams using REST APIs.
Modern applications integrate dozens or even hundreds of different APIs. The task is significant. These APIs must be called in a precise manner and sequence. API calls need to be chained together, feeding the output of one into the next. In some cases, it’s desirable to parallelize them for better performance. Synchronous services can be made async, and vice versa. Almost universally, it is necessary to filter, transform, and reformat the responses, as they are rarely an exact match for the needs of an application. Teams must properly handle errors and timeouts, not to mention authentication and authorization.
We can give a name to these tasks: API orchestration.
API orchestration accounts for a significant fraction of the total cost of implementing software. It shows up everywhere: application teams shipping roadmap items, companies migrating off of legacy software systems or onto modern microservice architectures, anyone acquiring products and integrating them together, and in every agentic AI project – the last of these especially top of mind now for many. And because orchestration requirements tend to be unique to each individual application or use case, teams end up accumulating a mountain of code dedicated to orchestration.
In the vast majority of cases, API orchestration is implemented procedurally, as code. This is the world of backends-for-frontends, integration APIs, and SDKs autogenerated from service catalogs. Sometimes the code is implemented as a separate tier, as in the BFF pattern. Other times, it lurks inside applications or services. No matter where it lives, this code is expensive to write and annoying to maintain. It holds API-rich companies back from shipping great products and getting the most value from their API investments.
GraphQL is graph-based API orchestration
What we’ve known all along is that GraphQL is really a technology for API orchestration. GraphQL federation, which we developed in collaboration with many of the teams using GraphQL at large scales, allows developers to write GraphQL queries that get executed as an automatically planned sequence of individual API calls. The heart of what makes this possible is an advanced runtime, the Apollo Router, that provides connection management, rate limits, error handling, API call chaining and more, all made available through GraphQL schemas and operations.
Most of the API orchestration tasks I listed above? They’re built right into the Apollo Router with our implementation of GraphQL federation. Apollo developers don’t write procedural code to cache API responses, enforce authentication policies, filter results, or join across APIs. To give one example of how much power comes with this, you can mark part of a query as “deferrable” which instructs the query planner to break the query into a synchronous portion and an async portion to be delivered later – typically data coming from slow APIs that you can’t allow to delay app interactivity or a screen render. Six characters and a couple of braces replace what would have been a significant amount of procedural code to write, test, and maintain.
GraphQL federation has been a huge success. It now powers many of the largest online retailers, media properties, traditional banks, and fintech startups. It’s probably inside your television and will almost certainly be in your next car. Companies that adopt this architecture are able to ship new products in a fraction of the time it used to take and with far less development risk.
Bringing GraphQL to everyone
There’s one hitch, though. To use graph-based API orchestration, you needed GraphQL APIs – either by adding GraphQL to existing services or by creating new GraphQL-specific services (what GraphQL federation developers call “subgraph servers”). This requirement was a significant up-front price of admission to the benefits of graph-based orchestration. And hearing customer after customer tell us about the REST APIs they wanted to bring to the graph led us to a key insight, which is that the responses from these APIs are awfully close to the entity objects that make up a federated GraphQL schema. All that’s really necessary is a language for describing the relationship between them.
And that leads us to today’s news: we’re making Apollo Connectors for REST APIs generally available, which lets you define a GraphQL schema in terms of the REST APIs you have and orchestrate calls to those APIs with just a few lines of configuration.
Connectors are meant to work with real-world APIs: they include functions you can use to restructure and transform API responses as needed and support the usual patterns for headers, auth credentials, and so on. And it’s just federated GraphQL under the hood, so you can use all the usual federation features and mix and match any combination of REST and GraphQL together. You can read much more technical detail about how Apollo Connectors work in our engineering blog, the documentation, or just give it a try with your own APIs. Everything you need is included in our free tier of GraphOS and you can be orchestrating APIs in well under an hour. Since we previewed Apollo Connectors at GraphQL Summit in October we’ve worked with many of you to improve every aspect of their tooling and functionality. Early results are promising: you can read about how the team at Cox Automotive used Apollo Connectors to add a particularly important API to their graph in just days, saving nearly a year of otherwise planned development work. We’re looking forward to hearing about your experience.
The future is declarative
Declarative architectures define the modern, cloud-native stack. Containerization for packaging software. React for packaging UI components. It should be no different for APIs. Apollo Connectors allows developers to describe the data model they want, and let Apollo’s graph-based API orchestration infrastructure figure out how to do it.
We believe declarative, graph-based orchestration is going to replace procedural orchestration code. We’re excited to see GraphQL become the standard that all developers can reach for and we’re committed to working with everyone interested to make that happen. And we can’t wait to see what you build with it.
Ready to get started? Try Connectors today with our new free tier, explore our documentation and Odyssey training courses, or join us at upcoming Connectors Live events to learn more. The future of APIs is here – powered by GraphQL-based API orchestration that makes it easier than ever to build applications. |