Skip to content

Handling aggregate objects #787

Closed
Closed
@Venefilyn

Description

@Venefilyn

In my application right now I've been aggregating database entries and serving them in a REST API. Though when it comes to graphene I've not had any luck getting aggregates to works. Any help would be thankful

Current code:

aggregated_snapshots = DjangoFilterConnectionField(IssueSnapshotNode)

def resolve_aggregated_snapshots(self, info, **kwargs):
    return IssueSnapshot.objects.order_by() \
        .values('status', type=F('issue__type_name')) \
        .annotate(status_count=Count('status'))

Error message returned:

Merging 'QuerySet' classes must involve the same values in each case

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions