Steams / ra-data-hasura-graphql

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

Make it possible to filter based on a nested field #76

Closed remiremi closed 3 years ago

remiremi commented 3 years ago

With this fix you could have a list filter that filters on a nested object field, for example doing


const ProductListFilter = (props: any) => (
  <Filter {...props}>
    <SelectInput
      label="Status"
      source="category.status"
      choices={[
        { id: "in_production", name: "In Production" },
        { id: "planned", name: "Planned" },
        { id: "retired", name: "Retired" }
      ]}
      emptyText="All"
      alwaysOn
    />
  </Filter>
);

export const ProductList = (props: any) => (
  <List
    {...props}
    filters={<ProductListFilter />}
    sort={{ field: "planting_date", order: "ASC" }}
    filterDefaultValues={{ category: { status: "in_production" } }}
  >
    .....
cpursley commented 3 years ago

@remiremi this repository is now depreciated. The Hasura organization has adopted and now maintains this library. Going forward, you can use this: https://github.com/hasura/ra-data-hasura

remiremi commented 3 years ago

Ok, maybe would make sense to update the description or archive this repository?

cpursley commented 3 years ago

Yep, I've got a PR here: https://github.com/Steams/ra-data-hasura-graphql/pull/78

remiremi commented 3 years ago

Okay I closed all my PRs in this repository and re-created them in hasura/ra-data-hasura