-
Notifications
You must be signed in to change notification settings - Fork 247
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
Custom primary key is not supported by the GraphQL helper #2061
Comments
Hi @a9udn9u thanks for opening this issue. Your model schema requires support of custom primary key (CPK).
Therefore, at this moment, amplify codegen cannot generate correct model for model schema that uses When Amplify CLI (and Amplify Codegen) support of CPK gets released, the codegen will generate correct model according to And we will work on making the GraphQL helper work with CPK soon, please stay tuned. Thanks! |
I'm closing this issue in favor of this feature request issue We will update the progress on the linked, please feel free to follow up and provide feedback and suggestions. Thanks! |
Description
I'm migrating an Amplify JavaScript project to Amplify Flutter, a few of my GraphQL models look like this:
Everything worked well in the JS project. I did an
amplify pull
in the new Flutter project, the GraphQL schema file was correctly pulled down, then I ranamplify codegen models
, aFoo.dart
is created, which looks like this:My code for querying data from the
Foo
table:I always get a validation error. "Validation error of type FieldUndefined: Field 'id' in type 'Foo' is undefined @ 'listFoo/items/id'". Why does codegen generate a model file that doesn't match the actual GraphQL model?
Categories
Steps to Reproduce
See description.
Screenshots
No response
Platforms
Android Device/Emulator API Level
No response
Environment
Dependencies
Device
N/A
OS
iOS 15.5
Deployment Method
Custom Pipeline
CLI Version
9.2.1
Additional Context
No response
Amplify Config
Not sure how to get this..
The text was updated successfully, but these errors were encountered: