type ApiKeyResult {
    totalCount: Int
    count: Int
    nodes: [ApiKey]
}

type ApiKeyHistory implements DbHistoryModel {
    id: Int
    identifier: String
    key: String
    permissions: [Permission]

    deleted: Boolean
    editor: String
    created: String
    updated: String
}

type ApiKey implements DbModel {
    id: Int
    identifier: String
    key: String
    permissions: [Permission]

    deleted: Boolean
    editor: User
    created: String
    updated: String

    history: [ApiKeyHistory]
}

input ApiKeySort {
    id: SortOrder
    identifier: SortOrder

    deleted: SortOrder
    editor: UserSort
    created: SortOrder
    updated: SortOrder
}

enum ApiKeyFuzzyFields {
    id
    identifier

    deleted
    editor
    created
    updated
}

input ApiKeyFuzzy {
    fields: [ApiKeyFuzzyFields]
    term: String
    threshold: Int
}

input ApiKeyFilter {
    id: IntFilter
    identifier: StringFilter

    deleted: BooleanFilter
    editorId: IntFilter
    created: DateFilter
    updated: DateFilter
}

type ApiKeyMutation {
    create(input: ApiKeyCreateInput!): ApiKey
    update(input: ApiKeyUpdateInput!): ApiKey
    delete(id: Int!): Boolean
    restore(id: Int!): Boolean
}

input ApiKeyCreateInput {
    identifier: String
    permissions: [Int]
}

input ApiKeyUpdateInput {
    id: Int!
    identifier: String
    permissions: [Int]
}