Open jackkemmish opened 3 months ago
One thing I'm also not quite following is although something like link
is available to the filter
argument, it's not actually allowing me to filter on it.
E.g.
query {
readPages(
filter: {
link: {
eq: "/"
}
}
) {
nodes {
__typename
id
title
link
}
}
}
This just throws an error:
"message": "Failed to resolve field readPages returning PageInterfaceConnection!.\\n\\n\n Got error: Couldn't run query:\n\nSELECT DISTINCT count(DISTINCT \"SiteTree_Live\".\"ID\") AS \"Count\"\n\nFROM \"SiteTree_Live\"\nLEFT JOIN \"Page_Live\" ON \"Page_Live\".\"ID\" = \"SiteTree_Live\".\"ID\"\n\nWHERE (\"Link\" = ?)\n AND (\"SiteTree_Live\".\"ClassName\" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))\n\nUnknown column 'Link' in 'where clause'\\n\\n\n Path: readPages\\n\\n\n Resolver (closure) failed in execution chain:\\n\\n\n array (\n 0 => \n array (\n 0 => 'SilverStripe\\\\GraphQL\\\\Schema\\\\DataObject\\\\ReadCreator',\n 1 => 'resolve',\n ),\n)\narray (\n 0 => \n array (\n 0 => 'SilverStripe\\\\Versioned\\\\GraphQL\\\\Resolvers\\\\VersionedResolver',\n 1 => 'resolveVersionedRead',\n ),\n)\narray (\n 0 => \n array (\n 0 => 'SilverStripe\\\\GraphQL\\\\Schema\\\\DataObject\\\\Plugin\\\\QueryFilter\\\\QueryFilter',\n 1 => 'filter',\n ),\n)\narray (\n 0 => \n array (\n 0 => 'SilverStripe\\\\GraphQL\\\\Schema\\\\DataObject\\\\Plugin\\\\QuerySort',\n 1 => 'sort',\n ),\n)\narray (\n 0 => \n array (\n 0 => 'SilverStripe\\\\GraphQL\\\\Schema\\\\DataObject\\\\Plugin\\\\Paginator',\n 1 => 'paginate',\n ),\n)\narray (\n 0 => \n array (\n 0 => 'SilverStripe\\\\GraphQL\\\\Schema\\\\DataObject\\\\Plugin\\\\CanViewPermission',\n 1 => 'permissionCheck',\n ),\n)\\n\\n\n Args: {\n \"filter\": {\n \"link\": {\n \"eq\": \"\\/\"\n }\n },\n \"limit\": \"100\",\n \"offset\": \"0\"\n}\\n\\n",
However I can filter on the title
or id
for example.
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 https://github.com/silverstripe/silverstripe-graphql/issues/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:
I would assume that the above would allow me to filter by ID on the
tagGroup
ortags
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.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
silverstripe/installer
(with any code examples you've provided)