@ra-data-prisma/dataprovider-v7.0.0
github-actions
released this
05 May 10:45
·
9 commits
to main
since this release
@ra-data-prisma/dataprovider-v7.0.0 (2023-05-05)
Bug Fixes
- cannot update array of objects when there is an _ids array present (#114) (edd7617)
- empty reference ids break create (5d484ba)
- in cases where both _ids and _id are used, there might be confusion (#115) (738071c)
- typing of args in customize resolve functions (#116) (d6de0b4)
Features
- disconnect entities when {id: null} or {id: ""} is sent (32693e7)
- fragments can now extend the default fields (#107) (f45a6df)
- orderByRelation is now enabled by default (fae06e1)
- prisma update typegraphql (#126) (4e746f8)
- references are now added as separate fields with suffix (#111) (5fc2d39)
BREAKING CHANGES
- orderByRelation is now enabled by default
also updates prisma and type-graphql version (only dev dependencies)
- aliasPrefix type changed
ReferenceArrayField/Input
orReferenceinput/Field
now require you to add a suffix to thesource
property:
_id
or_ids
(array).
E.g.
consider a relation between User and UserRole. A User has many UserRoles.
new:
<ReferenceArrayField
label="Roles"
source="roles_ids" // <-- suffix _ids because it is an array field
reference="UserRole"
>....
before:
<ReferenceArrayField
label="Roles"
source="roles" // <--- old approach
reference="UserRole"
>....
Reasoning
There was some sanitizing going on to support using the parent field name (e.g. "roles") directly,
without adding a suffix for convenience.
However there were some problems and inconsitency:
- if you use a custom fragment for a resource ("ResourceView") this sanitizing was already disabled
- mixing custom fragments with the default behavior lead to cache inconsistencies