Closed marcoboerner closed 1 month ago
Hey, thanks for raising this! I'm going to transfer this over to our codegen repository for better assistance.
I learned that it seems both models and the relations are actually created correctly. When I query for both, after the failed mutation, I get the correct results. It seems the issue is somewhere in the try await Amplify.API.mutate(request:.create(myModel))
method, or maybe one of the generated initializers.
The error message is expected here. You can remove this error message by lowering the statement max depth to 1 with --statement-max-depth 1
or by disabling subscriptions with a.model(...).disableOperations(['subscriptions'])
.
Please see the message at the top of this page for more details. https://docs.amplify.aws/react/build-a-backend/data/data-modeling/relationships/
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Environment information
Describe the bug
I defined a parent and child model in the resource.ts file and created Swift code with the CLI. When I try to create the model in my app, I get the following error:
Reproduction steps
Define the following model in the resource.ts file:
Create the Swift code with:
npx ampx generate graphql-client-code --format modelgen --model-target swift
Try to create the model with: