evoluteur / evolutility-ui-react

Framework for building CRUD UIs for Hasura GraphQL with models rather than code.
https://evoluteur.github.io/evodemo/
GNU Affero General Public License v3.0
113 stars 30 forks source link

Model.collections does not need a list of fields #20

Closed david-pfx closed 5 years ago

david-pfx commented 5 years ago

In any model collections is the specification of a child set. It is used on a browse screen to retrieve a list of child records displayed in master-detail format.

The fields information is redundant. It matches exactly the fields information in the child model, and can be retrieved as needed by accessing the child model (filtered presumably on inMany). For similar reasons the table and column attributes are also redundant.

evoluteur commented 5 years ago

...sometimes there is no child model.

david-pfx commented 5 years ago

How can that be so? There is no such sample, no way to load data without a model and no way to resolve the browse link unless the child has a model.

So by fiat, let it be so, the child must have a model.

david-pfx commented 5 years ago

I missed one thing: the child field list has the parent entity as a field, which needs to be filtered out.

Changes made. Submitting PR. See what you think.

evoluteur commented 5 years ago

Fields in collections can now be ids or field objects.

https://github.com/evoluteur/evolutility-ui-react/commit/20e8b30e2f256d4dbf3ec230ef66faf49b5c633b#diff-25d902c24283ab8cfbac54dfa101ad31