type GroupResult {
    totalCount: Int
    count: Int
    nodes: [Group]
}

type GroupHistory implements DbHistoryModel {
    id: Int
    name: String

    userSpace: UserSpace

    shortUrls: [ShortUrl]
    roles: [Role]

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

type Group implements DbModel {
    id: Int
    name: String

    userSpace: UserSpace

    shortUrls: [ShortUrl]
    roles: [Role]

    deleted: Boolean
    editor: User
    created: String
    updated: String
    history: [GroupHistory]
}

input GroupSort {
    id: SortOrder
    name: SortOrder

    deleted: SortOrder
    editorId: SortOrder
    created: SortOrder
    updated: SortOrder
}

enum GroupFuzzyFields {
    name
}

input GroupFuzzy {
    fields: [GroupFuzzyFields]
    term: String
    threshold: Int
}

input GroupFilter {
    id: IntFilter
    name: StringFilter

    userSpace: UserSpaceFilter

    fuzzy: GroupFuzzy

    deleted: BooleanFilter
    editor: IntFilter
    created: DateFilter
    updated: DateFilter

    isNull: Boolean
    isNotNull: Boolean
}

type GroupMutation {
    create(input: GroupCreateInput!): Group
    update(input: GroupUpdateInput!): Group
    delete(id: Int!): Boolean
    restore(id: Int!): Boolean
}

input GroupCreateInput {
    userSpaceId: Int!
    name: String!
    roles: [Int]
}

input GroupUpdateInput {
    id: Int!
    name: String
    roles: [Int]
}