Open davidhousedev opened 4 years ago
My solution: custom GraphQL field name value -> id
@hetaochen could you elaborate? Were you able to make this work in your own environment? Where did you apply that mapping?
I'm very new to react-admin and hasura here, my apologies if this should be obvious!
Ah, good idea! Thanks!
I wonder if there's another solution that could be implemented at the package level that would allow us to use a model without an id
. Going to leave this issue open for now.
Thanks for your work on this!
I'm hoping to switch over from the JSON API data provider to this data provider but encountered an issue with the
<ReferenceInput>
component on a foreign key relationship to a table that's configured in Hasura as a graphql enum.It seems there's some sort of coupling to the idea that every entity should have a distinct
id
, which is not allowed for graphql enums in Hasura.At first, I was encountering issues because the
sort
property on<ReferenceInput>
defaulted to sorting on id. I was able to override this like so:In the above example, a model
product
has a foreign key relationship on theproduct_type
column to aproduct_type
table on its primary key columnvalue
.However, this yielded a console error which prevented data from being populated in my
<SelectInput>
:The
product_type
table does not have anid
and I cannot add one because I want to use that table as a graphql enum. Does anyone know how I can get around this?