Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Got an unexpected keyword argument 'filters' #245

@he0119

Description

@he0119

Argument filters shows up in GraphiQL, but still got an error. It works fine before upgrading to v3.

image
image

Related code:
he0119/smart-home@9922c78#diff-af3602ede1befa32df28d961add5b48aaf07992465fb6d0f1dbb50e4a0568cdbR79-R85

@gql.django.type(models.Device, filters=DeviceFilter, order=DeviceOrder)
class Device(relay.Node):
    name: auto
    device_type: auto
    location: auto
    created_at: auto
    edited_at: auto
    is_online: auto
    online_at: auto
    offline_at: auto
    token: auto

    # FIXME: Device.autowatering_data() got an unexpected keyword argument 'filters'
    @gql.django.connection(
        gql.django.ListConnectionWithTotalCount[AutowateringData],
        filters=AutowateringDataFilter,
        order=AutowateringDataOrder,
    )
    def autowatering_data(self, info) -> Iterable[models.AutowateringData]:
        return models.AutowateringData.objects.all()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions