notrab
05/28/2017, 8:28 PM{
allReports(filter: {
dbrw_gte: 5,
dbrw_lte: 48,
manufacturer:{
id_in: [
"cj31o9k4y6jxo0127rybvmsac",
]
},
doorType_in: [
"Single"
]
}) {
id
dbrw
manufacturer {
name
}
doorType
doorWidth
}
}
If Iβm using Apollo for example, Is it possible to conditionally include the manufacturer id_in part?
Think of this as a sidebar on Amazon for filtering products. When someone clicks a checkbox I want to add the ID to the array but if no ID is given, include them all. Possible?nilan
05/28/2017, 8:30 PMmanufacturer filter object that's either {} or `{id_in: <some-list>}'notrab
05/28/2017, 8:35 PMnilan
05/28/2017, 8:36 PMfilter as an object variable πnotrab
05/28/2017, 8:38 PMnilan
05/28/2017, 8:43 PMnilan
05/28/2017, 8:44 PMfilter inputnilan
05/28/2017, 8:44 PMmanufacturer key or notnotrab
05/28/2017, 8:50 PMnotrab
05/28/2017, 8:50 PMnilan
05/28/2017, 9:02 PMnilan
05/28/2017, 9:02 PMnotrab
05/29/2017, 12:46 PMnotrab
05/29/2017, 12:46 PMnotrab
05/29/2017, 12:47 PMquery reports($filter: ReportFilter){
allReports(filter: $filter) {
id
dbrw
manufacturer {
id
name
}
doorType
doorWidth
}
}
Query variables:
{
"filter": {
"manufacturer": {
"id_in": [
"cj31o9k4y6jxo0127rybvmsac"
]
},
"doorType_in": [
"Double",
"Single"
]
}
}