Company
Date Published
Author
Michael Watson
Word count
1389
Language
English
Hacker News points
None

Summary

Integrating headless CMS data with any API using GraphQL requires connecting to multiple APIs and orchestrating requests. This can be achieved by using Apollo Connectors for REST, which allows quickly bringing multiple APIs together with a simple configuration. The example uses Strapi as the headless CMS and demonstrates how to set up a project locally, connect the CMS API, test the connector locally, host the Apollo Router, and publish the connector to GraphOS. The process involves creating a schema, adding source and selection directives, testing the connector, hosting the router, and publishing the connector to GraphOS, allowing for hot-reloading via Apollo Uplink. This pattern can be iterated on for any Content-Type defined in Strapi, giving flexibility to express CMS with other APIs without code duplication.