Skip to main content

Set up GraphQL clients

As Delivery Gateway uses a GraphQL API with a single endpoint, we recommend setting up a GraphQL client IDE to access it. There are multiple open source IDEs you can use. Check out the full list in the GraphQL organization tool directory: Tools and libraries.

tip

Learn more about GraphQL in our introductory guide: GraphQL

To set up a GraphQL IDE:

  1. Select a client. Popular examples include Altair, Apollo, Insomnia, or Relay.

  2. Set the Delivery Gateway Merchant API endpoint in the client: https://api.deliverygateway.io/graphql/merchant.

  3. Add an authorization header: Authorization: Bearer <TOKEN NUMBER>.

    Replace <TOKEN NUMBER> with your personal access token: Create Bearer access token. Different clients have different ways of adding the header: for example, some clients offer the option of selecting Bearer from a list of authentication options and you only need to manually input the actual token.

  4. Set the client's request method to POST. All GraphQL requests, including queries, are POST requests.

    note

    Some clients offer a GraphQL mode. If it's available, use it.

  5. If needed, fetch the schema to render documentation with an introspection query:

    query IntrospectionQuery {
    __schema {
    types {
    name
    }
    }
    }
    note

    Most clients automatically fetch the schema and render the documentation in a Docs panel.

When done, test the client: run some queries and mutations to make sure everything works as it should. To test things, we recommend using our sandbox environment.