Steams / ra-data-hasura-graphql

React-admin data provider for Hasura GraphQL endpoints
MIT License
211 stars 33 forks source link

Support Hasura (Postgres) text search types #44

Closed cpursley closed 4 years ago

cpursley commented 4 years ago

https://hasura.io/docs/1.0/graphql/manual/queries/query-filters.html#text-search-or-pattern-matching-operators-like-similar-etc

This is an interesting approach:

https://github.com/raphiniert-com/ra-data-postgrest#special-filter-feature

cpursley commented 4 years ago

While much more involved, it would also be neat to be able to search across multiple fields/columns. Maybe something like this (I'm not sure the best approach for delineating the sources) :

<TextInput label="Search" source="title@ilike,body@like,author@similar" alwaysOn />

webdeb commented 4 years ago

@cpursley its already supported (not multiple but for a single field it should work as expected)

cpursley commented 4 years ago

In that case @Steams ~ can you make a note of search usage in the README?

Also, how involved do you think a feature for searching across multiple fields would be? I imagine you'd have to generate multiple query params (instead of just the one) that Hasura would understand, so effectively like having multiple Search inputs.

webdeb commented 4 years ago

can you make a note of search usage in the README?

@cpursley maybe you can contribute to that too?

webdeb commented 4 years ago

Btw. @cpursley if you would like to implement your multifield-search idea, the changes should go somewhere here: https://github.com/webdeb/ra-data-hasura-graphql/blob/master/src/buildVariables.js#L37

cpursley commented 4 years ago

can you make a note of search usage in the README?

@cpursley maybe you can contribute to that too?

Steams and I are working together on a project that utilizes this library (me on the backend) :)

cpursley commented 4 years ago

Resolved by https://github.com/Steams/ra-data-hasura-graphql/pull/50