Connect to Strapi
Headless CMS

Strapi is an open-source, headless CMS that allows developers to create different Content-Types, like Product or Blog, and access those resources through a robust REST API. Connectors enables you to quickly orchestrate any Strapi resource with your other APIs by writing a schema - not code.

Try out the Connector!

  • Click ► GetProduct to run the operation. You just got back real data from a Strapi REST API! Don't see GetProduct? Try closing the tab in Sandbox.

  • Toggle the Response dropdown and select Query Plan. This is the strategy for executing an incoming operation efficiently.

  • Toggle the Query Plan dropdown to Connectors Debugger to click into the details of each request.

Prebuilt Getting Started

  • Create a new graph in GraphOS and follow the "Set up your local development environment" instructions.

  • Update your local router.yaml file to configure your STRAPI_API_KEY with read access to Users - be sure to update your supergraph.yaml to use the same subgraph name (users)

# router.yaml
connectors:
  subgraphs:
    users.strapi:
      $config:
        apiKey: ${env.STRAPI_API_KEY}
        
# supergraph.yaml
federation_version: =2.10.0
subgraphs:
  users:
    routing_url: http://strapi-users
    schema:
      file: users.graphql
  • Copy the prebuilt Connector file content into the .graphql file in your local project. Strapi ships with a default User Content-Type that the prebuilt Connector uses. You can copy the pattern for any Content-Type you have defined in your Strapi instance.

  • Run rover dev with your STRAPI_API_KEY:

export STRAPI_API_KEY=...
rover dev \
  --supergraph-config supergraph.yaml \
  --router-config router.yaml

Connectors resources