In order to start querying your Content from Agility using GraphQL, you'll need to authenticate your requests and set up your GraphQL API client.
To start, head over to the GraphQL IDE Playground in your Instance by going to Settings > API Keys and clicking on the Explore GraphQL API button.
You'll notice your GraphQL API URL endpoint that you'll want to update to include the following:
- Your Instance GUID.
- Indicate whether you want to source Published Content (Fetch) or Staging Content (Preview).
- The locale you wish to retrieve content from.
Next, you'll also need to authenticate your request by adding your API Key as a header. To do this, click on the Set Headers button located on the left of the GraphQL API Playground.
Which API Key do I use?
If you're fetching Published content and have defined it by using `fetch` in your GraphQL API URL endpoint, be sure to use your Fetch API Key.
If you're fetching Staging content and have defined it by using `preview` in your GraphQL API URL endpoint, be sure to use your Preview API Key.
Click Save to save your API Key as a header in your request.
Once you've updated your GraphQL API URL and added your API Key as a header, you can click on the Reload button to reload the Docs.
Once you've reloaded the Docs, you can click on the Docs button, and you should see Root. If you click on Root, you'll then be able to see the Content queryable from your Instance.