query repositoryIDByName($name: String!) {
    me {
        repository(name: $name) {
            id
        }
    }
}

query repositoryIDByUser($username: String!, $name: String!) {
    user(username: $username) {
        repository(name: $name) {
            id
        }
    }
}

query repositories($cursor: Cursor) {
    repositories(cursor: $cursor) {
        ...repos
    }
}

query repositoriesByUser($username: String!, $cursor: Cursor) {
    user(username: $username) {
        repositories(cursor: $cursor) {
            ...repos
        }
    }
}

fragment repos on RepositoryCursor {
    results {
        name
        description
        visibility
        owner {
          canonicalName
        }
    }
    cursor
}

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

mutation createRepository(
    $name: String!
    $visibility: Visibility!
    $description: String!
) {
    createRepository(
        name: $name
        visibility: $visibility
        description: $description
    ) {
        name
    }
}

mutation deleteRepository($id: Int!) {
    deleteRepository(id: $id) {
        name
    }
}

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

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