GraphQL API Quickstart
This tutorial will show you how to use the Aviator GraphQL API to access pull request data from your Aviator account.
1. Create a user access token
Create a user access token from the Aviator webapp.
Enter
GraphQL tutorial
for the token name.Select
30 days
for the token expiration.
This should be in the format av_uat_abcdefghijklmnopqrstuvwxyz
. Make sure to save this value as it can't be accessed again after leaving the token creation page.
In your terminal, set the AV_API_TOKEN
environment variable to the value of the token you just created:
2. Make a simple GraphQL request
Make sure that you've set the AV_API_TOKEN
environment variable to the value of the token you created in step 1. Requests can be made with any HTTP client.
A simple curl request to fetch the full name of the user making the request looks like:
The output should be similar to:
3. Fetch data about a pull request
The following example fetches the title and current status of a pull request. Make sure to change the owner
, name
, and number
variables to match your desired repository and pull request.
The output should be similar to:
Learn more
See the official Introduction to GraphQL tutorial to learn more about GraphQL.
Last updated