aws-amplify / aws-amplify/amplify-codegen
Request: Add missing `owner` field to generated Dart models
- Dominant language
- TypeScript
- Stars
- 59
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
### 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](https://github.com/aws-amplify/amplify-codegen/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-codegen/blob/main/CONTRIBUTING.md#bugs).
- [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.owner`
- `Blog.OWNER.eq('user_name')`
### Reproduction steps
n/a
### GraphQL schema(s)
```graphql
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!
}
```
Contributor guide
Assessment
This issue has not been assessed yet.