-
Goal: I would like users to be able to use filter add on available on tables where data is retrieved from GraphQL.
-
Steps: I have setup a data table in Retool with source of data is a GraphQL query. I have enabled tooltip add on with Filter option. I understand the format of
filter
that this option generates when you add rules and add groups. I am unsure as to what graphql input type would support this dynamic structure. -
Details: GraphQL requires strict data types and I cannot use UNION in input data type. I would like to know how to setup input type that can represent JSON/object structure filter generates.
If I understand your question correctly, you are trying to pass the filter from a table to your backend through a graphql mutation.
If this is the case, the simplest option I can see without recreating the filter schema (which is totally doable, this may help you), is passing it as a string, and just stringifying the filter using JSON.stringify(table.filterstack)
. Then you can parse the string in your backend and filter as needed.
Let me know if this isn't what you meant!