Using Apollo Federation with Local Schemas
Blog post from Apollo
The author of the blog post needed to add a third-party API to their Apollo Federation Gateway schema without creating a new service. They used local schemas inside the Apollo Gateway, which requires specifying a list of GraphQL services as objects with a name and a URL. However, they encountered issues using Prismic's GraphQL API directly due to its GET requests instead of POST requests and lack of necessary fields for federation. To overcome this, they created a custom DataSource that proxies the requests to Prismic by building a local schema using `buildService` and providing a function called `getCountriesSchema`. This function uses utilities from `graphql-tools` and `graphql-transform-federation` to create a proxy schema with support for Federation. The author concludes that while it requires some code, this approach simplifies how clients fetch data and enables the use of Apollo Federation features with non-federated services.
No tracked trend matches for this post yet.
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.