0

I'm trying to make a filter for react admin using ra-data-hasura as the dataProvider.

If I simply try and add {foreign_id: {_is_null: true}} I get many errors as it resolves into { foreign_id: _eq: { {_is_null: true} } }. Using {foreign_id: null} also fails as that appears to be the default value.

What's the best way to get my List to show only rows where a column is either NULL or not null?

I'm using Postgres as my database if that matters.

James
  • 87
  • 1
  • 8
  • This seems like it should be core functionality supported by `ra-data-hasura` I'd recommend opening an issue there and seeing if they'll add official support for this – Jesse Carter May 17 '21 at 20:25
  • > I get many errors . Which exactly errors? `foreing_id` is a value for foreign key in another table? If so - than it would be better to show structures of your tables and graphql-query that leads to "many errors" – Alex Yu May 18 '21 at 17:35

1 Answers1

3

There is an undocumented hasura-raw-query, which should help you here.

...
<List
...
filter={{
  foreign_id: {
    format: "hasura-raw-query",
    value: { __is_null: true },
  },
}}
>
...
Steven Bell
  • 1,755
  • 10
  • 20