type KeycloakUserResult {
    totalCount: Int
    count: Int
    nodes: [KeycloakUser]
}

type KeycloakUser {
    keycloakId: String
    username: String
}

type UserResult {
    totalCount: Int
    count: Int
    nodes: [User]
}

type User implements DbModel {
    id: ID
    keycloakId: String
    username: String
    email: String
    roles: [Role]

    deleted: Boolean
    editor: User
    createdUtc: String
    updatedUtc: String
}

input UserSort {
    id: SortOrder
    keycloakId: SortOrder
    username: SortOrder
    email: SortOrder

    deleted: SortOrder
    editorId: SortOrder
    createdUtc: SortOrder
    updatedUtc: SortOrder
}

input UserFilter {
    id: IntFilter
    keycloakId: StringFilter
    username: StringFilter
    email: StringFilter

    deleted: BooleanFilter
    editor: IntFilter
    createdUtc: DateFilter
    updatedUtc: DateFilter
}

type UserMutation {
    create(input: UserCreateInput!): User
    update(input: UserUpdateInput!): User
    delete(id: ID!): Boolean
    restore(id: ID!): Boolean
}

input UserCreateInput {
    keycloakId: String
    roles: [ID]
}

input UserUpdateInput {
    id: ID
    roles: [ID]
}