Skip to main content

How to issue a query

Communicating with GraphQL

It's easiest to use a GraphQL client to make calls (see Using Apollo Sandbox with EventsAir's GraphQL API), but since GraphQL is accessed over HTTP, you can use curl or any library that communicates with HTTP.

For GraphQL queries that require authorization, include an Authorization HTTP header with a value of Bearer {{YOUR_ACCESS_TOKEN}} (substituting "{{YOUR_ACCESS_TOKEN}}" with your access token).

To query GraphQL in a curl command, make a POST request with a JSON payload. The payload must contain a string called query:

curl -X POST -d " \
{ \
\"query\": \"TestQuery { healthcheck }\" \
} \
" https://api.eventsairtest.com/graphql
note

You must escape newline characters in the string value of "query" to ensure that the query is parsed correctly. For the POST body, use outer double quotes and escaped inner double quotes.

Using Apollo Sandbox with EventsAir's GraphQL API

The following steps will help you get up to speed quickly with Apollo Sandbox and the EventsAir GraphQL API. For more information see Apollo Sandbox in the Overview section.

  1. Browse to Apollo Sandbox

  2. The Operation section includes a pre-defined query name TestQuery. This query does not require any authentication, so you can run it directly by clicking on the TestQuery button.

  3. In the Response section, you should see the following JSON returned:

    {
    "data": {
    "healthcheck": "Hello from the EventsAIR GraphQL API"
    }
    }
  4. Complete the steps in Get an access token and copy the access token value to your clipboard.

  5. Click on the gear icon in the header to open the Connection settings interface: A cropped screenshot of the Apollo Sandbox browser-based GraphQL IDE with a red arrow indicating the icon that opens the Connection settings interface.

  6. In the Connection settings interface:

    • In the Shared headers section, add an Authorization header with value Bearer {{YOUR_ACCESS_TOKEN}} (remembering to use the value of your access token from step 4.)
    • The Connection settings interface should look similar to: A screenshot of the Apollo Sandbox Connection settings interface with a red rectangle highlighting the "Authorization" header to be added.
    • Click on the Save button to save your changes.
  7. You should now be able to issue queries that require authorization.

EventsAir GraphQL API schema reference

To understand what you can do with the EventsAir GraphQL API, review the schema reference describing its supported operations and objects.

Usage limits

Please review the EventsAir GraphQL API usage limits to understand usage limits built into the API.