Skip to main content
Version: v0.14

GraphQL API

Conduit exposes a GraphQL server for you to perform GraphQL requests.
Your application-level GraphQL path is /graphql.
You may always retrieve the exact url through the Admin Panel.

GraphQL Button

Navigating to the above URL through your web browser should bring up GraphQL Playground.
You can use that to test out your requests.

Performing Requests

Performing certain GraphQL queries requires that you pass in certain application request headers.
What this typically means is passing along an Authorization header for your user authenticated requests.
If you've enabled clientValidation for your application requests, you'll additionally provide a security client id and secret pair.

User Authenticated Request Headers Example
{
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYyMzQ3MjMzYTQ5ODg4MGNkOWI4MDY5ZSIsImlhdCI6MTY0NzYwNDk5OCwiZXhwIjoxNzM0MDA0OTk4fQ.D_TsIaQlMimft4CXhCo_aOs0vk6opnClxM3aFtFF4Qc"
}

Upon specifying your headers in the GraphQL Playground page, your route documentation should become available to you.
Lets perform our first query, shall we?

Let's make a query to find out which chat rooms are currently registered in our database!
This should return an array containing the ids of the registered chat rooms.
Make sure the Chat module is currently online.

Example Request
query getRooms($skip: Number,$limit:Number) {
getChatRooms(skip: $skip, limit:$limit) {
rooms {
_id
}
}
}
Example Query Variables
{
"skip": 0,
"limit": 0
}