MrHertal/react-admin-amplify

1:1 relationships

Closed this issue · 2 comments

As there's no example on the demo code I've tried to get one to one relationships working. There is no problem when you only try to create entries in the table using the standard create component. But if you try to update a record there throws an error saying "The variables input contains a field name 'ABC' that is not defined for input object type '123' ". As mentioned, with exactly the same schema creations are possible which uses ABC at 123-type.

the schema looks like this:

@model
{
id: ID!
something: String
}

type 123
  @model
{
id: ID!
anything: String
abcID: ID
abc: abc! @connection(fields: ["abcID"])
}

Hi, it looks similar to that issue: #41

Please try the transform props as described here: #41 (comment)

@pafela this is caused by a bug in react-admin. You need to use a transform on your Edit component to remove the abc key from the input sent to the graphql mutation.