System Information
v4.1.8 :
MacOs :
SQL :
12.22.0 :
6.14.11 :
I’m trying to make a query and filter through the lists based on a field but I get an error
“Unknown argument “filters” on field “Query.blogs”.”
query GetBlog {
blogs(filters: {slug: { eq: "test"}}) {
data {
id
}
}
Any help would be appreciated, thanks
1 Like
Same problem here.
It just allows sorting but not filtering.
Yeah same issue I’m having here, only allows sorts and I don’t want to use fetch a single item by id
Found this:
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
opened 03:07PM - 16 Apr 22 UTC
<!--
Hello 👋 Thank you for submitting an issue.
Before you start, please mak… e sure your issue is understandable and reproducible.
To make your issue readable make sure you use valid Markdown syntax.
https://guides.github.com/features/mastering-markdown/
Please ensure you have also read and understand the contributing guide.
https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md#reporting-an-issue
-->
## Bug report
### Required System information
- Node.js version: v16.14.0
- NPM version: 8.3.1
- Strapi version: 4.1.8
- Database: Postgres
- Operating system: Linux
### Describe the bug
In my latest builds the filters and pagination attributes are not included in the schema. The only difference if found is that I've add some custom-routes, but I'm not sure how that would affect it.
### Steps to reproduce the behavior
- Still working on reproducibility
### Expected behavior
Filters and pagination to always be built in graphql schema unless specified otherwise
In /home/yoyo/Documents/my-strapi/node_modules/@strapi/plugin-graphql/server/services/content-api/index.js
there is a call to pruneSchema
from @graphql-tools/utils
package which leaves only the sort argument in the generated content type schemas. It seems that this happens with the latest version 8.6.8 of @graphql-tools/utils
. If we force the version 8.6.7 the schemas are generated correctly. I added this in the package.json
"resolutions": { "@graphql-tools/utils": "8.6.7" }
This did not regenerate the filters. Still looking for a solution.
3 Likes
forum won’t let me edit my post anymore.
I was able to get this solution to work.
I had to yarn cache clear
I may have also had to delete yarn.lock and run yarn install
, but I’m not sure if that was necessary.
1 Like
This worked for me as well, I had to add it as a dependency but all good now, thanks for this
2 Likes