Links

GraphQL Mutations

Example GraphQL mutations with authentication.
To get started, login into Sleuth and open GraphiQL.

Create new Code Deployment

Mutation Example
Variables (with webhooks)
Variables (with build tracking)
1
mutation CreateCodeDeployment($input: CreateCodeChangeSourceMutationInput!) {
2
createCodeChangeSource(input: $input) {
3
changeSource {
4
name
5
slug
6
repository {
7
provider
8
owner
9
name
10
url
11
}
12
notifyInSlack
13
includeInDashboard
14
}
15
}
16
}
1
{
2
"input": {
3
"projectSlug": "<test-project>",
4
"repository": {
5
"name": "<repo-name>",
6
"owner": "<repo-owner>",
7
"url": "https://gitlab.com/<repo-owner>/<repo-name>",
8
"provider": "GITLAB"
9
},
10
"name": "Test Code Deployment",
11
"deployTrackingType": "MANUAL",
12
"environmentMappings": {
13
"environmentSlug": "production",
14
"branch": "main"
15
},
16
"environmentMappings": {
17
"environmentSlug": "staging",
18
"branch": "main"
19
}
20
}
21
}
Supported values for the provider field are AZURE, BITBUCKET, CUSTOM_GIT, GITHUB, GITHUB_ENTERPRISE, or GITLAB.
1
{
2
"input": {
3
"projectSlug": "<test-project>",
4
"repository": {
5
"name": "<repo-name>",
6
"owner": "<repo-owner>",
7
"url": "https://gitlab.com/<repo-owner>/<repo-name>",
8
"provider": "GITLAB"
9
},
10
"name": "Test Code Deployment",
11
"deployTrackingType": "BUILD",
12
"environmentMappings": {
13
"environmentSlug": "production",
14
"branch": "main"
15
},
16
"environmentMappings": {
17
"environmentSlug": "staging",
18
"branch": "main"
19
},
20
"
21
}
22
}
Supported values for the provider field are AZURE, BITBUCKET, CUSTOM_GIT, GITHUB, GITHUB_ENTERPRISE, or GITLAB.