query fetchMe {
    me {
        ...user
    }
}

query fetchUser($username: String!) {
    userByName(username: $username) {
        ...user
    }
}

fragment user on User {
    canonicalName
    email
    url
    location
    bio
}

query listSSHKeys {
    me {
        ...sshKeys
    }
}

query listSSHKeysByUser($username: String!) {
    userByName(username: $username) {
        ...sshKeys
    }
}

fragment sshKeys on User {
    sshKeys {
        results {
            id
            fingerprint
            comment
        }
    }
}

query listRawSSHKeys {
    me {
        ...sshKeysRaw
    }
}

query listRawSSHKeysByUser($username: String!) {
    userByName(username: $username) {
        ...sshKeysRaw
    }
}

fragment sshKeysRaw on User {
    sshKeys {
        results {
            key
        }
    }
}

query listPGPKeys {
    me {
        ...pgpKeys
    }
}

query listPGPKeysByUser($username: String!) {
    userByName(username: $username) {
        ...pgpKeys
    }
}

fragment pgpKeys on User {
    pgpKeys {
        results {
            id
            fingerprint
        }
    }
}

query listRawPGPKeys {
    me {
        ...pgpKeysRaw
    }
}

query listRawPGPKeysByUser($username: String!) {
    userByName(username: $username) {
        ...pgpKeysRaw
    }
}

fragment pgpKeysRaw on User {
    pgpKeys {
        results {
            key
        }
    }
}

query auditLog {
    auditLog {
        results {
            created
            ipAddress
            eventType
            details
        }
    }
}

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

mutation createSSHKey($key: String!) {
    createSSHKey(key: $key) {
        fingerprint
        comment
    }
}

mutation createPGPKey($key: String!) {
    createPGPKey(key: $key) {
        fingerprint
    }
}

mutation deleteSSHKey($id: Int!) {
    deleteSSHKey(id: $id) {
        fingerprint
    }
}

mutation deletePGPKey($id: Int!) {
    deletePGPKey(id: $id) {
        fingerprint
    }
}

mutation createUserWebhook($config: ProfileWebhookInput!) {
    createWebhook(config: $config) {
        id
    }
}

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