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

Can not generate models without @model directive #420

Closed
dajojo opened this issue Mar 2, 2021 · 4 comments
Closed

Can not generate models without @model directive #420

dajojo opened this issue Mar 2, 2021 · 4 comments
Assignees
Labels
Codegen Issues related to Amplify code generation

Comments

@dajojo
Copy link

dajojo commented Mar 2, 2021

Describe the bug
In my schema I want to nest a model into another without using an additional table.
'Amplify codegen models' outputs no errors but does only create empty files for models without @model directive. The generated flutter code for the other models is invalid aswell since some model classes are missing but referenced.

To Reproduce
Steps to reproduce the behavior:

  1. Enter schema:
type Parent @model {
	id: ID! 
	children: [Child] 
} 

type Child {
	id: ID! 
	content: String
}
  1. Run 'amplify codegen models'
  2. See missing classes

Expected behavior
Proper generation for missing classes

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):
[x] Android
[x] iOS

@kjones
Copy link

kjones commented Mar 2, 2021

Putting another vote in here to get this fixed. #260 is where I'm at.

@haverchuck haverchuck added the Codegen Issues related to Amplify code generation label Mar 2, 2021
@fjnoyp
Copy link
Contributor

fjnoyp commented Mar 3, 2021

Thanks for linking the issues @kjones

Currently this is not supported @dajojo as we do not generate the dart class for non model classes defined in your schema and have no support for them in our code. We will investigate fixing this missing feature and provide more details in the above linked issue #260.

@fjnoyp
Copy link
Contributor

fjnoyp commented Mar 3, 2021

@dajojo as this issue is the same as #260 do you mind if we close this issue so we can keep the issue consolidated?

@dajojo
Copy link
Author

dajojo commented Mar 3, 2021

@fjnoyp Thanks for the fast reply!
I would appreciate this feature since it is very important for using a NoSQL database correctly.
Closed for duplication

@dajojo dajojo closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codegen Issues related to Amplify code generation
Projects
None yet
Development

No branches or pull requests

4 participants