mutation createPaste($files: [Upload!]!, $visibility: Visibility!) {
    create(files: $files, visibility: $visibility) {
        id
        user {
            canonicalName
        }
    }
}

mutation delete($id: String!) {
    delete(id: $id) {
        id
    }
}

mutation update($id: String!, $visibility: Visibility!) {
    update(id: $id, visibility: $visibility) {
        id
    }
}

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

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

query pastes($cursor: Cursor) {
    pastes(cursor: $cursor) {
        results {
            id
            created
            visibility
            files {
                filename
            }
        }
        cursor
    }
}

query pasteContents($cursor: Cursor) {
    pastes(cursor: $cursor) {
        results {
            ...pasteContents
        }
        cursor
    }
}

query pasteContentsByID($id: String!) {
    paste(id: $id) {
        ...pasteContents
    }
}

fragment pasteContents on Paste {
    id
    created
    visibility
    files {
        filename
        contents
    }
}

query pasteCompletionList {
    pastes {
        results {
            id
            files {
                filename
            }
        }
    }
}

query showPaste($id: String!) {
    paste(id: $id) {
        id
        created
        visibility
        files {
            filename
            contents
        }
        user {
            canonicalName
        }
    }
}

query userWebhooks($cursor: Cursor) {
    userWebhooks(cursor: $cursor) {
        results {
            id
            url
        }
        cursor
    }
}
