Open arealmaas opened 3 years ago
@phani-srikar any updates on this?
I am still getting error for union
type
@arealmaas did you find any solution on this
Would love for y'all to create this functionality. It would seriously simply my scenarios in the future
API, Typescript, Bug, Codegen models
Describe the bug $
amplify codegen models
fails to generate models when a union type or an interface is used in the graphql schema.Amplify CLI Version: amplify -v: 4.45.1
Platform target: web
To Reproduce:
When using
amplify codegen models
I get the following error:Error: Unknown type Todo for field todos. Did you forget to add the @model directive
Expected behavior I expected to get models successfully generated. I cannot both use union/interface types in my schema and generate typescript-models, as no models will be generated because of this error. To fully utilize amplify I want to be able to generate the typescript models as well.
To circumvent the fact that Amplify doesn't support interface/unions I added a function resolver to resolve the correct type as was suggested in an issue somewhere. But now I'm having issues with the codegen. Could you please let this case go as a warning instead of an error, or fix the types for union/interface? 🤔