EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/docs/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
Connectors Performance Overview
Optimize REST API integrations in your GraphQL API
Apollo Connectors are designed with performance in mind, providing efficient ways to incorporate REST APIs directly into your graph through the GraphOS Router.
Subgraph approach vs. direct integration
Before Connectors, integrating a REST API into your graph required spinning up a passthrough GraphQL API:
With Connectors, you eliminate the need for that additional service:
This architecture provides the following performance benefits:
Reduced network hops with direct router-to-REST communication
Lower operational complexity without additional services to deploy and maintain
Router performance overhead
The GraphOS Router is optimized to handle Connector requests with minimal overhead:
Low latency processing of REST API requests and responses
Parallel execution of independent REST API requests when possible
Efficient response transformation through declarative mapping language that executes directly in the router runtime
When comparing direct REST calls to Connector-based integration, the additional router processing adds only milliseconds of overhead while providing the significant benefits of GraphQL's declarative data fetching.
Response caching
Connectors don't currently cache responses, and no configuration options exist to tune caching for Connectors. The router routes Connector subgraphs through a separate execution path from standard GraphQL subgraphs, so router caching plugins don't apply to Connector subgraphs:
Enabling
preview_entity_cachefor a subgraph that uses Connectors has no effect. The router logs a warning that the plugin isn't supported for that subgraph.Cache-Controlheaders returned by an upstream REST API aren't inspected or honored.
If your use case depends on caching Connector responses, implement caching in the upstream REST API itself (for example, with response headers your CDN or API gateway honors) instead of relying on the router.
Next steps
First, ensure that you're using batch requests whenever possible.
Additionally, the following configurations help prevent overwhelming backend services:
Request limits (this is also a security feature)