Using the GraphQL Playground

GraphQL Playground

The GraphQL Playground is "a fully-featured GraphQL IDE for better development workflows." It was created by Prisma and is included by default in all WellLine deployments.
For more information see the following documentation: https://oss.prisma.io/content/graphql-playground/overview
The playground environment provides a graphical way to interact with data from tenants your user account has access to. It is also a straightforward way to introspect the TimeLine Service schema, to learn about all the ways in which you can interact with the service.

How do I access the TimeLine Service through the GraphQL Playground?

Problem

I want to set up the playground environment to securely access WellLine data.

Solution

To access the GraphQL playground, open your browser and navigate to the /playground path of your TimeLine Service. For example, if the URL of your TimeLine Service is https://cloud-timeline.wellline.com, navigate to the URL:
https://cloud-timeline.wellline.com/playground
You will see a screen that looks like this:
The GraphQL Playground environment
Before you can successfully call the TimeLine Service from the GraphQL playground you must acquire an authentication token and configure the GraphQL Playground "HTTP HEADERS" tab (bottom of the playground interface) to pass it as a header with your calls to the TimeLine Service.
To configure the "HTTP HEADERS" area to properly pass your authentication token, configure it as follows:
HTTP HEADERS tab
Take note of the placement of quotation marks. Replace <TOKEN> with your authentication token
{"authorization": "Bearer <TOKEN>"}
After the headers area is configured, the "error": "Unexpected token < in JSON at position 0" message will be removed, indicating the playground can access the TimeLine Service.

How do I execute a query against the TimeLine Service in the GraphQL Playground?

Scenario

I have already set up my playground to authenticate and now want to experiment interactively with the TimeLine Service to try out some GraphQL queries and/or quickly explore data in WellLine.

Solution

Query execution takes place in text entry panel on the left:
Query example which returns a count of all events for the 'boem' tenant
Click the "Play" button or CMD+Enter / CTRL+Enter to run the query.
Query results appear on the right:
For examples of queries, see Working With TimeLines.