Skip to content

Nested filtering issue #588

@jackkemmish

Description

@jackkemmish

Module version(s) affected

5.2

Description

Hi there,

I am trying to filter on a field which is part of a page type I have, but I am getting a an error e.g. Failed to resolve field readOneResourcePage returning ResourcePageInterface..

I have seen this open ticket around nested filtering #307 but can also see in the docs I should be able to filter by default here Nested fields are supported by default: https://docs.silverstripe.org/en/5/developer_guides/graphql/working_with_dataobjects/query_plugins/

How to reproduce

I am still very much in the learning stages here so I may be missing something, but here is my code (I have reduced it for the example):

Schema:

models:
  Sdots\App\ResourcePage:
    fields:
      '*': true
      link:
        type: String
        property: Link
    operations:
      read: true
      readOne:
        plugins:
          getByLink: true
  Sdots\App\ResourceListPage:
    fields:
      '*': true
      link:
        type: String
        property: Link
    operations:
      read: true
      readOne:
        plugins:
          getByLink: true
  Sdots\Tagging\Model\TagGroup:
    fields: '*'
    operations:
      read: true
  Sdots\Tagging\Model\Tag:
    fields: '*'
    operations:
      read: true

I would assume that the above would allow me to filter by ID on the tagGroup or tags as it's exposed in the schema. I have also attached an image of the structure of the schema in the GraphQL IDE, and the error.

Screenshot 2024-05-18 at 21 01 28 Screenshot 2024-05-18 at 21 02 12

I feel like I'm either missing something, or something is not working :/

Thanks in advance.

Jack

Possible Solution

No response

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions