For the complete documentation index, see llms.txt. This page is also available as Markdown.

GraphQL Queries

Example GraphQL queries with authentication.

GraphiQL

To get started, login into Sleuth and open GraphiQL

GraphQL Query
{
  user {
    display
  }
}
query GetNumberOfTeamDeploys($orgSlug: ID!, $start: DateTime!, $end: DateTime!, $teamSlugs: [ID]) {
  organization(orgSlug: $orgSlug) {
    metricsRecap(start: $start, end: $end, filters: {teamSlugs: $teamSlugs}) {
      numOfDeploys
    }
  }
}
{
  "orgSlug": "sleuth",
  "start": "2022-07-01T00:00:00Z",
  "end": "2022-07-31T00:00:00Z",
  "teamSlugs": [
    "frontend-2"
  ]
}
query GetNumberOfProjectDeploys($orgSlug: ID!, $start: DateTime!, $end: DateTime!, $projectSlugs: [ID]) {
  organization(orgSlug: $orgSlug) {
    metricsRecap(start: $start, end: $end, filters: {projectSlugs: $projectSlugs}) {
      numOfDeploys
    }
  }
}
{
  "orgSlug": "sleuth",
  "start": "2022-07-01T00:00:00Z",
  "end": "2022-07-31T00:00:00Z",
  "projectSlugs": [
    "sleuth"
  ]
}

cURL and API key

Using cURL you can call Sleuth GraphQL API from any environment.

Now use API Key in authorization header (required headers are content-type and authorization)

Last updated

Was this helpful?