hasura / ra-data-hasura

react-admin data provider for Hasura GraphQL Engine
MIT License
336 stars 70 forks source link

Search inside list using SelectInput #122

Open ghost opened 2 years ago

ghost commented 2 years ago

Hello everyone.

I've been trying to run this where query in GraphQL using the library:

"where": {
  "_and": [
    {
      "config": {
        "_contains": {
          "steps": [
            {
              "sources": [
                {
                  "integration_id": 784
                }
              ]
            }
          ]
        }
      }
    }
  ]
}

When I use SelectInput, I can't make ra-data-hasura put the [] between steps and sources:

<SelectInput
  label="Integration ID"
  source="config@_contains.steps.sources.integration_id"
  choices={integrationsPerOrg}
  alwaysOn
/>

The code generated by this source is:

"where": {
  "_and": [
    {
      "config": {
        "_contains": {
          "steps": {
            "sources": {
              "integration_id": 784
            }
          }
        }
      }
    }
  ]
}

What I should do to generate the right where query in the first example?