is FilterListItem corrent?
kulame opened this issue · comments
kulame commented
i try to filter by FilterListItem
import { FilterList, FilterListItem, FilterLiveSearch } from "react-admin";
<FilterListItem
label="本日"
value={{
updated_at_gte: endOfYesterday().toISOString(),
updated_at_lte: undefined,
}}
/>
it generate where clause
{
"where": {
"_and": [
{
"updated_at_gte": {
"_eq": "2022-04-20T15:59:59.999Z"
}
}
]
}
}
i think it will generate
{
"where": {
"_and": [
{
"updated_at": {
"_gte": "2022-04-20T15:59:59.999Z"
}
}
]
}
}
daa commented
I guess that correct syntax for Hasura would be updated_at@_gte
unlike example given in react-admin documentation page.
arjunyel commented
Thank you so much @daa !!!! Yes I can confirm updated_at@_gte
generates the correct where clause:
<FilterListItem
label="本日"
value={{
'updated_at@_gte': endOfYesterday().toISOString(),
'updated_at@_lte': undefined,
}}
/>
{
"where": {
"_and": [
{
"updated_at": {
"_gte": "2022-04-29T04:59:59.999Z"
}
}
]
},
"limit": 10,
"offset": 0,
"order_by": {
"id": "asc"
}
}