amplify-codegen
amplify-codegen copied to clipboard
Request: Add missing `owner` field to generated Dart models
Before opening, please confirm:
- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have searched for duplicate or closed issues.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
How did you install the Amplify CLI?
No response
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
10.8.1
What operating system are you using?
Mac
Amplify Codegen Command
codegen models
Describe the bug
Feature Request
Currently the generated Dart models lack the owner property when using appropriate auth rules despite this field existing in AppSync. This creates friction for Amplify-Flutter devs trying to make or filter requests including the owner field in a type safe manner.
Expected behavior
When I run amplify codegen models, I expect the generated Dart models to have a public owner field and associated query field definition. Such that I can access the following:
Blog.ownerBlog.OWNER.eq('user_name')
Reproduction steps
n/a
GraphQL schema(s)
type Post @model @auth(rules: [{allow: private, provider: iam,},
{ allow: owner, operations: [create, read, update, delete] }]){
id: ID!
title: String!
content: String
comments: [Comment] @hasMany
}
type Comment @model @auth(rules: [{allow: private, provider: iam},
{ allow: owner, operations: [create, read, update, delete] }]){
id: ID!
content: String
post: Post @belongsTo(fields: ["postCommentsId"])
postCommentsId: ID!
}
n/a
Additional information
No response