-
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
codegen models doesn't generate id for belongs-to connection #148
Comments
Hi @marlonmarcello. Thanks for reporting this. We will look into this soon and let you know. |
Hi @marlonmarcello, can you try to pass in the
|
This is not an issue with passing in data, it's an issue with generating the correct types. We have the same exact issue, where not only certain properties are removed in the TS definitions, but also Example:
results in: export declare class OrderAssignment {
readonly id: string;
readonly businessId: string;
readonly order?: Order;
readonly designWorkflowStageId: string;
readonly status: OrderAssignmentStatusType | keyof typeof OrderAssignmentStatusType;
constructor(init: ModelInit<OrderAssignment>);
static copyOf(source: OrderAssignment, mutator: (draft: MutableModel<OrderAssignment>) => MutableModel<OrderAssignment> | void): OrderAssignment;
} Two things to note:
|
Experience the same problem. In my use case I'm trying to selectively sync DataStore against the "disappeared" id field which clearly won't work unless the field exists locally. Trying to find a work around but this seems like a bug. Did you find any solutions? |
Hi, |
I'm experiencing the same issue with Swift models. |
Before opening, please confirm:
I have searched for duplicate or closed issues.
I have read the guide for submitting bug reports.
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
React
Amplify APIs
GraphQL API, DataStore
Amplify Categories
api
Environment information
Describe the bug
By following the tutorial on the docs on how to create a belongs-to connection I came up with the following graphql.schema:
After that, I ran
amplify codegen
andamplify codegen models
.The generated model was the following:
Issue 1:
Notice that the
Email
class is missingprojectID
.Issue 2:
Because of Issue 1, when using typescript the following error is given:
Expected behavior
amplify codegen models
should include theprojectID
field on the generated class.Reproduction steps
amplify init
amplify add api
amplify codegen models
Notice the missing connection ID.
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
The text was updated successfully, but these errors were encountered: