Skip to content

GraphQL filters (AND, OR and NOT) don't work for custom filterset fields #17688

@arthanson

Description

@arthanson

Deployment Type

Self-hosted

NetBox Version

v4.1.3

Python Version

3.10

Steps to Reproduce

Using a GraphQL filter with AND, OR, NOT for a field that has custom implementation in the filterset (or only appears in the filterset) for example asn_id on Site. Doesn't work

  1. Create 4 sites with ID's 1 to 4
  2. Create 4 ASNs and assign each to a single Site (1-4)
  3. Use the following GraphQL query
{
  site_list(filters: {asn_id: "1", OR: {asn_id: "4"}}) {
    name
    asns {
      id
    }
  }
}

Expected Behavior

Will get a list of 2 sites.

Observed Behavior

Get an empty list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    netboxseverity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtopic: GraphQLtype: bugA confirmed report of unexpected behavior in the application

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions