mutation publish(
    $domain: String!
    $content: Upload!
    $protocol: Protocol!
    $subdirectory: String!
    $siteConfig: SiteConfig!
) {
    publish(
        domain: $domain
        content: $content
        protocol: $protocol
        subdirectory: $subdirectory
        siteConfig: $siteConfig
    ) {
        domain
    }
}

mutation unpublish($domain: String!, $protocol: Protocol!) {
    unpublish(domain: $domain, protocol: $protocol) {
        domain
    }
}

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

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

mutation updateSiteACL($siteId: Int!, $userId: Int!, $input: ACLInput!) {
    updateSiteACL(siteId: $siteId, userId: $userId, input: $input) {
        entity {
            canonicalName
        }
    }
}

mutation deleteSiteACL($id: Int!) {
    deleteSiteACL(id: $id) {
        entity {
            canonicalName
        }
    }
}

query sites($cursor: Cursor) {
    sites(cursor: $cursor) {
        results {
            id
            domain
            protocol
        }
        cursor
    }
}

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

query userID($username: String!) {
    user(username: $username) {
        id
    }
}

query acls($domain: String!, $protocol: Protocol!, $cursor: Cursor) {
    site(domain: $domain, protocol: $protocol) {
        acls(cursor: $cursor) {
            results {
                id
                created
                entity {
                    canonicalName
                }
                publish
            }
            cursor
        }
    }
}
