Open akamit21 opened 4 years ago
hi Akamit21,
I am a novice (at least as a developer) myself but I hope this helps you.
In the readme for ra-data-hasura it has a section on different primary keys
best regards,
Chris
Have a similar question as @akamit21 !
(@affluent-bilby-classifieds that is for a different library that is not compatible with ra-data-hasura-graphql. I'm actually in the process of migrating from that library to this one.)
A guess would be some modification here: https://github.com/Steams/ra-data-hasura-graphql#customize-fields-variables-responseparser ?
Have a similar question as @akamit21 !
(@affluent-bilby-classifieds that is for a different library that is not compatible with ra-data-hasura-graphql. I'm actually in the process of migrating from that library to this one.)
Yes, I tried to implement but didn't work out.
Having the same issue, with the added complication that I am using composite primary keys. Did any of you figure it out?
Nope, not yet, but to resolve my primary key problem I rename the primary key
column to id
when it fetches the data and generates the data-list, in that way I receive my primary-key
column renamed as id
.
@akamit21 can you show an example of your workaround on how you are renaming the primary key to id while fetching the data? it would be nice to have a option to configure that.
@divramod agreed. @akamit21 could you show an example?
Well, I made the changes in getResponseParser.js
file of the library. I had a employee table with primary_key
name emoloyee_id
. So I add only these line in code and it worked.
if (key === 'employee_id') { return { ...acc, id: dataKey }; }
My table has a primary key other than id and react-admin enforces id to be returned in the response by the DataProvider. So can I configure different primary keys/identifiers for my resources?