Open brianlenz opened 9 months ago
Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂.
Thanks, @ykethan!!
Hey @brianlenz , Thank you for reporting this. We are able to replicate the issue by following the description. Hence, we are marking this a bug for the team to evaluate further.
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
18.19.0
Amplify CLI Version
12.10.1
What operating system are you using?
macOS 14.3
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No.
Describe the bug
We have a simple model with a custom
@primaryKey
(stripping other fields for clarity), e.g.:Everything gets created and looks good, but when creating a
File
through the mutation, the record inserted into DynamoDB includes both afilename
and a separateid
field. Theid
field should not be included. It's properly excluded from the GraphQL schema, but theid
field shouldn't be inserted into the database.Expected behavior
There is no
id
field in the database.Reproduction steps
amplify push
to create.Project Identifier
593c2cb7ef11977e0a84a81fe1b204c9
Log output
Additional information
I'm guessing the issue is in the generated resolver:
MutationcreateFileinit0Function
. Specifically, the resolver has this:And I'm guessing that's what's causing the problem. This should be omitted when using a custom
@primaryKey
.Before submitting, please confirm: