Weakky / ra-data-opencrud

A react-admin data provider for Prisma and GraphCMS
MIT License
159 stars 45 forks source link

[RFR] Allow overriding queries by using fragments #7

Closed Weakky closed 6 years ago

Weakky commented 6 years ago

Used both gql and literral strings to show it is possible to use both.

I was able to remove all <ReferenceField /> and <ReferenceManyField /> by simples <TextField /> and <ArrayField />, meaning all <List /> components now load in a single query. Performances were more than greatly improved.

The only cons right now is that we'll have to manually handle refs to other resources as react-admin no longer can automatically generate the <Link />.

Here's a codesandbox plugged on that branch:

Edit ra-data-prisma