where in operator for 2 columns filter #7594
-
Hello, I have an array of objects including 2 filter parameter like and I'm searching a quick way to use it directly in my query such as _in operator Is there anyway to pass a json object as query parameter resulting as below query MyQuery { |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can pass the whole query MyQuery ($where: product_bool_exp $limit: Int = 1000 $offset: Int = 0 $orderBy: [product_order_by!]) {
product(where: $where, limit: $limit, offset: $offset, order_by: $orderBy) {
title
}
} Then you pass the variables as you would expect: {
"where":{
"_or": [
{"category_id": {"_eq": 1}, "brand_id": {"_eq": 1}},
{"category_id": {"_eq": 5}, "brand_id": {"_eq": 16}},
{"category_id": {"_eq": 7}, "brand_id": {"_eq": 20}}
]
},
"limit": 1000,
"offset": 0,
"orderBy": [{"date": "desc"}]
} I hope this helps |
Beta Was this translation helpful? Give feedback.
You can pass the whole
where
argument as a query variable:Then you pass the variables as you would expect:
I hope this helps