Skip to content
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

Request: Add missing owner field to generated Dart models #556

Open
4 tasks done
Equartey opened this issue Mar 9, 2023 · 0 comments
Open
4 tasks done

Request: Add missing owner field to generated Dart models #556

Equartey opened this issue Mar 9, 2023 · 0 comments
Labels
Dart Target language: Dart feature-request New feature or request

Comments

@Equartey
Copy link
Contributor

Equartey commented Mar 9, 2023

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • 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.

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)

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! 
}
Log output

n/a

Additional information

No response

@Equartey Equartey added feature-request New feature or request Dart Target language: Dart labels Mar 9, 2023
@Equartey Equartey changed the title Request: Add missing owner field to generated moe Request: Add missing owner field to generated Dart models Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dart Target language: Dart feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant