Draft your queries
You can test your GraphQL queries on real Prepr data using the API Explorer tool. Check out this article to learn more.
Before using the API Explorer, make sure to upload demo data during the onboarding or to complete the initial setup of your Prepr environment.
Prepr provides you with an interface based on the Apollo Explorer to test your requests before integrating them into production. Within the API Explorer, you can write and validate your GraphQL queries, make a test run of the queries, and receive responses from the Prepr API straightaway.
You can open the API Explorer in two ways.
From the Access token details page:
- Navigate to Settings → Access tokens and click on the desired access token record to open its details.
- On the Access token details page, click Open in API Explorer under the API URL field.
From the Content item details page:
- Navigate to the Content tab and click on the desired content item record to open its details.
- On the Content item details page, click Open in API Explorer in the sidebar on the right.
Use this option if you want to try out the query request for a particular content item.
Whatever option you choose, you’ll be redirected to the API Explorer interface similar to this:
Your API endpoint URL and schema will be registered in the API Explorer automatically, so you are ready to go.
-
Use the Operation pane to compose a query.
-
On the left of the Operation pane, you will see the Documentation pane that shows all the fields and arguments available in your schema. Click the plus icon next to the needed element to add it to your query.
-
(Optional) In the lower part of the Operation pane, there are two additional tabs – Variables and [Headers(/graphql-api/api-basics#the-headers), where you can specify dynamic arguments and key-value pairs accordingly.
-
Once you’ve built your query, click Run.
-
Check the API response in the Response pane on the right. The response is available in both an interactive JSON and table format. You can also copy the response to your clipboard, download it as a CSV, or download the JSON.
-
If the query results suit you, copy the query to implement it into your production easily.
Learn more about the API Explorer in the Apollo documentation (opens in a new tab).
Was this article helpful?
We’d love to learn from your feedback