Login 24/7 Support Community tyk.io

GraphQL Shared Types

Insert Lead paragraph here.

Creating a subgraph via the Dasboard UI

  1. Log in to the Dashboard and go to APIs > Add New API > Federation > Subgraph.

Add federation subgraph

  1. Choose a name for the subgraph and provide an upstream URL.

Note

In case your upstream URL is protected, select Upstream Protected and provide authorisation details (either Header or Certificate information).

Add upstream URL

  1. Go to Configure API and configure your subgraph just as you would any other API in Tyk.

Note

In v4.0 subgraphs will be set to Internal by default.

  1. Once you have configured all the options click Save. The subgraph is now visible in the list of APIs.

Subgraph API listing

Creating a supergraph via the Dasboard UI

  1. Log in to the Dashboard and go to APIs > Add New API > Federation > Supergraph.

Add supergraph API

  1. In the Details section select all the subgraphs that will be included in your supergraph.

Select subgraphs

  1. Go to Configure API and configure your supergraph just as you would any other API in Tyk.
  2. Once you configure all the options click Save. The supergraph is now available in your list of APIs.

Supergraph API listing

Defining Global Headers

In v4.0 you can define global (Supergraph) headers. Global headers are forwarded to all subgraphs that apply to the specific upstream request.

Setting a Global Header

  1. After creating your supergraph, open the API in your Dashboard.
  2. From the Subgraphs tab click Global Headers.

Global Header setup for a supergraph

  1. Enter your header name and value. You can add more headers by clicking Add Headers.

Add further Global headers in a supergraph

  1. Click Update to save the header.
  2. On the pop-up that is displayed, click Update API.
  3. If you want to delete a global header, click the appropriate bin icon for it.
  4. You can update your headers by repeating steps 2-5.