You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to build a filter, the obvious use case is to build up a dictionary of values that trigger filtering through Hasura. And all is fine and dandy. That is, until you try to utilize the _in or _nin filters. These filters are for array filtering. This is a very common type of filtering for finding matches in an array of values (think tagging).
These filters are quite buggy. They really do not work without serious customization, which is a problem on data heavy projects.
Let's say I have a table with thousands of products. However, only 20-30 of them have a certain type of specialty tags. After building the filter array in a variable ($someFilterArray) and querying against the tags, everything works fine. That is, unless the query does not require any filters. This would require setting $someFilterArray to null. Every other filter works just fine in the sense. Except for nested querying with _in and _nin. When querying these nested objects with the array filters, only rows with values will return, even when null is passed.
There are workarounds with using an empty object to check if the rows exist and building up a boolean expression. Solution found here.
The text was updated successfully, but these errors were encountered:
When trying to build a filter, the obvious use case is to build up a dictionary of values that trigger filtering through Hasura. And all is fine and dandy. That is, until you try to utilize the _in or _nin filters. These filters are for array filtering. This is a very common type of filtering for finding matches in an array of values (think tagging).
These filters are quite buggy. They really do not work without serious customization, which is a problem on data heavy projects.
Let's say I have a table with thousands of products. However, only 20-30 of them have a certain type of specialty tags. After building the filter array in a variable ($someFilterArray) and querying against the tags, everything works fine. That is, unless the query does not require any filters. This would require setting $someFilterArray to null. Every other filter works just fine in the sense. Except for nested querying with _in and _nin. When querying these nested objects with the array filters, only rows with values will return, even when null is passed.
There are workarounds with using an empty object to check if the rows exist and building up a boolean expression. Solution found here.
The text was updated successfully, but these errors were encountered: