-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL Transformer issue when using custom @key and @connection #3702
Comments
Yes this is a bug in the graphql-transformer
Yes, This should work when using named connections. When using |
Duplicate of #3438 |
Closing in favor of #3438 |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Problem:
When defining schemas with custom keys, or explicit keys defined along with a field with a
@connection
directive, the GraphQL transformer expects that the input object of a mutation provide both the id/key and the connected type Input.Example:
input
forPostEditor
:A few notes from the generated
input
:postID
accounts for the connection betweenPost
andPostEditor
, so I believepost: PostInput!
should not be there, regardless of it's optional or not, given that cascade writes are not supported as of now (is that a fair assumption?)editorID
is there, buteditor: UserInput!
is not, which seems inconsistent given howpostID
andpost: PostInput!
was handledpostID
andeditorID
were not explicitly defined, I would expect the input to havepostEditorPostId
andpostEditorUserId
automatically generated, but in no scenariopost: PostInput!
should be there. Is that correct?Scenario 1: Customs keys
The expected transformed input is:
Scenario 2: Connections with no custom keys
The expected transformed input is:
Possible related issues:
The text was updated successfully, but these errors were encountered: