Open jkeczan opened 8 months ago
An update:
When we isolate GaugeLocation as the only type in the Union, the corresponding code in api.service is generated correctly. However, as soon as we add 2nd type to the Union it fails.
If we remove GaugeLocation from the union altogether, all types in the union generate successfully.
The only difference between GaugeLocation and the rest of the type definitions is it has a complex type for one of its properties.
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
18.18.2
Amplify CLI Version
12.10.1
What operating system are you using?
Mac
Amplify Codegen Command
codegen
Describe the bug
When we run Amplify codegen setup for Angular, we are getting incorrect typename generation. Currently, on a single type only, we are getting typename: string instead of __typename: 'TypeName'
Expected behavior
When we generate Angular Code with Codegen, the __typename should be set to the name of the custom type it belongs too
Reproduction steps
Run Amplify CodeGen with the schema listed below.
GraphQL schema(s)
Log output
Additional information
Right now, everything compiles and deploys correctly if we manually modify api.service.ts to update
typename: string --> typename: 'GaugeLocation'
This is working correctly for our other 75+ types and inputs but this one set is causing the issue.
.graphqlconfig.yml
api.service