GraphQL Playground

GraphQL Playground

SEEK provides a read-only Playground environment designed to approximate the production SEEK API. The Playground environment is populated with a mix of manually curated and automatically generated mock objects. This provides a number of benefits over testing against production:
  • None of the mock objects contain the personal information of real people. This eliminates the possibility of exposing sensitive data during testing.
  • The mock objects are in a variety of states that can be hard to find in production data. For example, there are mock candidate applications with every possible combination of attachments.
  • The curated mock objects have stable object identifiers and data. This makes it easy to perform repeatable tests against a known set of data.
Due to its read-only nature, it’s not possible to execute mutations in the Playground environment. All mutations will fail with a FORBIDDEN error after they validate their input.

Authentication

As in production, all Playground requests require an access token. You can use your Playground credentials to request a partner token with the https://test.graphql.seek.com audience.
A partner token can be requested from the command line on macOS, Linux or Windows Subsystem for Linux:
Bash
Copy
curl --request POST \
 --url https://auth.seek.com/oauth/token \
 --header 'content-type: application/json' \
 --data '{"client_id":"Contact SEEK","client_secret":"Contact SEEK","audience":"https://test.graphql.seek.com","grant_type":"client_credentials"}'
The provided token will expire in 24 hours at which point it will need to be re-requested.

Accessing the Playground

The Playground environment uses the same GraphQL endpoint as the production SEEK API: https://graphql.seek.com/graphql.
Requests to the Playground are distinguished by their access token and scheme ID. Instead of using the seekAnz & global scheme IDs to refer to production, you would use seekAnzPublicTest & globalPublicTest in their place.

Browser usage

You can interactively query the GraphQL Playground using https://graphql.seek.com/graphql .
To start, the access token that was requested from the authentication step should be included in the HTTP headers tab. The HTTP headers tab accepts a JSON object in the format {"Authorization": "Bearer ey..."}:
HTTP headers example
With the Authorization header set, the GraphQL Playground can be freely interacted with.

Running example queries

There are examples of GraphQL queries throughout the developer documentation. Once you find an interesting query you can open it in the GraphQL Playground using the button in the top right corner of the code block:
GraphQL
{
  version
}
Most example queries also include query variables in a second tab:
QueryVariables
query ($id: String!) {
  candidate(id: $id) {
    person {
      name {
        given
        family
      }
    }
  }
}
Due to a limitation in the GraphQL Playground, these must be separately copy & pasted in to its “Query Variables” tab.

Mock objects

There are a number of manually curated mock objects available for testing. Refer to the mock objects documentation for a categorised list of available objects.