System Information
-
Strapi Version: 3.5.3
-
Operating System:macos
-
Database: postgre
Hello, I am using graphql .One model is a product that has attributes. I want to filter all products that have attributes with ids:[1,2,3] 1 AND 2 AND 3
I have tried in many ways using _where but nothing works .
Any suggestion?
Hi,
try without where and use the filter builder, using eq, or, and…
eg: filter: { id: { in: [1, 2, 3] } }
Without more context that’s all I can come up with, since I literally just researched this in a Gatsby integration documentation issue…
You cant use filter in graphql query in strapi .
My query is the bellow . I am
{
products(where: { productAttributes: { id_in: [“8”, “2”, “3”] } }) {
name
productAttributes {
id
}
}
}
I am getting this result
{
“data”: {
“products”: [
{
“name”: “GPS”,
“productAttributes”: [
{
“id”: “8”
}
]
},
{
“name”: “GPS ναυτικό”,
“productAttributes”: [
{
“id”: “2”
},
{
“id”: “3”
},
{
“id”: “8”
}
]
}
]
}
}
I want to keep the second record only
Sorry for not replying quicker, got caught up in a lot of things.
Am I correct to assume you have it sorted now? If not, feel free to ping here