Skip to content

Add better tests for GraphQL filtering and lookupΒ #15569

@arthanson

Description

@arthanson

Proposed Changes

The GraphQL tests currently test all model fields, but are very light on testing any filtering of objects or sub-objects. We should add tests for checking different primary filters:

{
  site_list(filters: {name: {i_contains:"DM"}}) {
    id
    name
  }
}

and sub-object filtering:

{
  site_list {
    id
    name
    tags(filters: {name: {i_starts_with: "P"}}) {
      name
    }
  }
}

Justification

The filtering logic for Strawberry is undergoing some major refactors and we could easily miss issues with filtering without tests in-place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions