Replies: 1 comment
-
On 2nd thought, this probably isn't worth bothering with. It makes more sense to fix this on the client side and thus avoiding this type of pain on every potentially filterable query method. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have the following query method...
...where
ProviderFilter
is simply a series of properties that we can filter on that largely match theIndicatedProvider
, e.g...On the frontend, I'm giving Refine w/ MUI a try. While implementing a MUI DataGrid, the built-in filtering works by taking whatever property you wish to filter, and appending the filter operation type to it with a potential value, and responds with that as part of the
where
method argument. So the following example filters:lastName equals "Doe"
firstName contains "John"
middleName starts with "C"
...becomes:
Which results in a potential explosion of argument types since there are 7 different operation types and each property can potentially have all 7.
What I want to do is given a set of property names, expose all those variations as part of the schema thus they appear as valid queries to any clients. But upon actually receiving the query I want to parse the response such that
firstName_contains: "John"
can be broken down into simply...Basically, I'm trying to avoid having to define every possible variation of every property in my ProviderFilter class, and instead parse and break down each argument into a simpler form. I've been poking around the code a bit looking at InputConverters but struggling to make sense of it since there are no docs and in the case of InputConverters, no tests demonstrating their usage.
Beta Was this translation helpful? Give feedback.
All reactions