-
Notifications
You must be signed in to change notification settings - Fork 63
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
Critical Bug: Missing teamId Field in amplify-flutter Model Causes GraphQL Mutation Errors #923
Comments
could anyone help? I think this is a very basic feature. Why there's such a bug. |
Another issue is that it cannot to invoke the method when customize secondary indexes. It didn't generate a code named "listCustomerByAccountRepresentativeId" in dart code, but I found it in the amplify console AI playground. flow the guide: https://docs.amplify.aws/flutter/build-a-backend/data/data-modeling/secondary-index/ |
Hey @fct-devops, Thanks for raising this. I have a follow-up question: Could you clarify how you generated the models? |
Thanks for your response. I run the follow cmd to generate: |
Hey @fct-devops, Thank you for providing the additional details. We were able to reproduce the issue using the instructions for Dart models. As a result, we are marking this as a bug for the team to evaluate further. |
Environment information
Codegen packages
Description
Bug Description:
The amplify-flutter data modeling for Has Many relationships appears to have a discrepancy between the official documentation and the generated model, leading to runtime errors when creating a Member. Below are the steps to reproduce the issue, the observed behavior, and the associated error details.
1. Steps to Reproduce:
Follow the Amplify Flutter tutorial on relationships.
Generate the models for a Member with a Has Many relationship to Team.
Observe the generated Member model:
Expected: teamId field should be present (per the documentation).
Actual: Only a team field is generated.
Attempt to create a Member instance by providing a Team instance to initialize Member.
Send the createMember GraphQL mutation request.
// resource.ts
// flutter code
2. Observed Behavior:
3. Expected Behavior:
The Member model should include a teamId field as per the tutorial, allowing Member to be initialized with teamId directly. The mutation request should succeed without including unnecessary Team model details.
4. Error Logs:
The text was updated successfully, but these errors were encountered: