Working with GraphQL

Bloodbath proposes a powerful GraphQL API.

It's the same API we use internally for developing our applications, most notably our own dashboard. We follow a Relay stylearrow-up-right of schema.

If you're new to GraphQL, Apollo has resources for beginnersarrow-up-right. The official documentationarrow-up-right is another good starting point.

Prerequisite

Acquire your API keychevron-right

Endpoint

Bloodbath's GraphQL endpoint is:

https://api.bloodbath.io/graphql

It supports introspection so you can query the whole schema.

Authorization

To start querying the endpoint, you must add the API key to your authorization headers.

{
  "headers": {
    "authorization": "Bearer <Your API key>"
  }
}

Check your access

Once you have the headers in place you can ping the GraphQL API

It should respond with something like

Examples

List events

circle-info

You'll notice that a difference between id and eventId; we have a Relay style schema. It means we have to map a node id and the event id has to be put on the side.

Find an event

Last updated