GraphQL reference

schema.graphql
schema {
query: Query
mutation: Mutation
}
type Query {
logs(id: ID!, stage: LogStage!, token: String): LogsResponse!
name: String
oauthRedirect: OAuthRedirect!
oauthToken(code: String!, temporaryToken: String!): String!
oauthUser(token: String!): User!
queue: [Run!]!
run(id: ID!): Run!
runs(before: ID): [Run!]!
tasks(before: ID): [Run!]!
scope: Scope
user: User
variables: [Variable]!
workers: [Worker!]!
}
type Mutation {
runCancel(id: ID!): Run!
runConfirm(id: ID!): Run!
runDiscard(id: ID!): Run!
runRetry(id: ID!): Run!
runTrigger(message: String!, refreshState: Boolean): Run!
taskCreate(command: String!): Run!
variableAdd(name: String!, value: String!, writeOnly: Boolean!): Variable!
variableDelete(id: ID!): Variable!
workerDrain(id: ID!): Worker!
}
type Commit {
author: String!
branch: String!
hash: String!
message: String!
timestamp: Int!
url: String!
}
type Delta {
add: Int!
before: Int!
change: Int!
destroy: Int!
}
type ExternalTrigger {
message: String
timestamp: Int!
username: String
}
type LogMessage {
message: String!
timestamp: Int!
}
type LogsResponse {
exists: Boolean!
finished: Boolean!
hasMore: Boolean!
hash: String!
messages: [LogMessage!]!
nextToken: String
}
type OAuthRedirect {
providerUrl: String!
temporaryToken: String!
}
type Run {
id: ID!
blocker: Run
command: String
commit: Commit
delta: Delta
errorMessage: String
finished: Boolean!
history: [RunStateTransition!]!
scope: Scope!
startedAt: Int!
state: RunState!
title: String!
trigger: RunTrigger!
type: RunType!
updatedAt: Int!
version: Int!
}
type RunStateTransition {
state: RunState!
timestamp: Int!
until: Int
username: String
}
union RunTrigger = Commit | ExternalTrigger
type Scope {
binary: String!
domain: String!
mode: ScopeMode!
name: String!
project: String!
target: String!
}
type User {
id: ID! # username
identity: IdentityProvider!
jwt: String!
validUntil: Int!
write: Boolean!
}
type Variable {
id: ID! # variable name
value: String
writeOnly: Boolean!
}
type Worker {
id: ID!
run: Run
startedAt: Int!
state: WorkerState!
version: String!
}
enum IdentityProvider {
GITHUB
}
enum LogStage {
PLANNING
APPLYING
}
enum RunState {
UNKNOWN
BLOCKED
WAITING
CANCELED
PLANNING
PLAN_FAILED
PLAN_CRASHED
NO_CHANGES
HAS_CHANGES
ERROR
UNCONFIRMED
AUTOCONFIRMED
DISCARDED
CONFIRMED
APPLYING
APPLY_FAILED
APPLY_CRASHED
APPLIED
REFRESHING
NOTHING_TO_RECONCILE
REFRESHING_FAILED
REFRESHING_CRASHED
RECONCILING
RECONCILED
RECONCILING_FAILED
RECONCILING_CRASHED
PERFORMING
PERFORMED
PERFORMING_FAILED
PERFORMING_CRASHED
}
enum RunType {
UNKNOWN
LOCAL_CHANGE
PROPOSED_CHANGE
TRACKED_CHANGE
RECONCILIATION
TASK
}
enum ScopeMode {
MANUALLY_CONFIRM
AUTO_CONFIRM
RECONCILE
}
enum WorkerState {
IDLE
BUSY
DRAINING
DRAINED
DEAD
}