GraphQL Playground
The API Playground was an in-browser tool for testing, running and sharing Dagger API queries. It has since been decommissioned.
The recommended approach is to use the dagger query
sub-command, which provides an easy way to send raw GraphQL queries to the Dagger API from the command line.
Running the GraphQL API locally​
In order to run the GraphQL API locally and explore, you can follow these steps:
note
This will start the Dagger GraphQL server and allow CORS requests on http://127.0.0.1:8080/query
.
You can then use a GraphQL client like Altair to connect to the API server and explore the Dagger API/schema.
- Install Dagger CLI and a container runtime (e.g. Docker)
- Clone or create a Dagger module repository (you can use the CI quickstart as a starting point)
- Open a terminal and navigate to the root of your Dagger module repository (the directory with the
dagger.json
file) - Set the
DAGGER_SESSION_TOKEN
environment variable totest
(or your desired token) - Run the following command:
env DAGGER_SESSION_TOKEN=test dagger listen --allow-cors
- Use Basic Authentication with the
DAGGER_SESSION_TOKEN
value as the username and password (e.g.test
would be the headerAuthorization: Basic dGVzdDo=
)