mutation submit($manifest: String!, $tags: [String!], $note: String) {
    submit(manifest: $manifest, tags: $tags, note: $note) {
        id
        owner {
            canonicalName
        }
    }
}

mutation cancel($jobId: Int!) {
    cancel(jobId: $jobId) {
        id
    }
}

mutation createUserWebhook($config: UserWebhookInput!) {
    createUserWebhook(config: $config) {
        id
    }
}

mutation deleteUserWebhook($id: Int!) {
    deleteUserWebhook(id: $id) {
        id
    }
}

query monitor($id: Int!) {
	job(id: $id) {
		status
		log { fullURL }
		tasks {
			name
			status
			log { fullURL }
		}
	}
}

query manifest($id: Int!) {
    job(id: $id) {
        manifest
        owner {
            canonicalName
        }
    }
}

query jobIDs {
    jobs {
        results {
            id
        }
    }
}

query jobs($cursor: Cursor) {
    jobs(cursor: $cursor) {
        ...jobs
    }
}

query jobsByUser($username: String!) {
    userByName(username: $username) {
        jobs {
            ...jobs
        }
    }
}

fragment jobs on JobCursor {
    results {
        id
        status
        note
        tags
        tasks {
            name
            status
        }
    }
    cursor
}

query exportJobs {
    jobs {
        results {
            id
            status
            note
            tags
            log {
                fullURL
            }
            tasks {
                name
                status
                log {
                    fullURL
                }
            }
        }
    }
}

query show($id: Int!) {
    job(id: $id) {
        id
        runner
        status
        note
        tags
        log {
            fullURL
        }
        tasks {
            name
            status
            log {
                fullURL
            }
        }
    }
}

query secrets {
    secrets {
        results {
            created
            uuid
            name
        }
    }
}

query getSSHInfo($id: Int!) {
    job(id: $id) {
        id
        runner
    }

    version {
        settings {
            sshUser
        }
    }
}

query runningJobs {
    jobs {
        results {
            id
            status
            note
            tags
        }
    }
}

query artifacts($id: Int!) {
    job(id: $id) {
        artifacts {
            path
            size
            url
        }
    }
}

query userWebhooks {
    userWebhooks {
        results {
            id
            url
        }
    }
}
