Open hisham opened 2 years ago
npm
14.15.3
7.6.5
mac
api
codegen
Try this graphql query
updateDate( newDate: AWSDateTime! ): AWSDateTime! @function(name: "MyGraphQLResolverFn-${env}")
The typescript codegen code produced will be:
async UpdateDate( newDate: string ): Promise<UpdateDateQuery>
But the type UpdateDateQuery won't be defined in API.service.ts
UpdateDateQuery
If I remove the exclamation mark in the AWSDateTime return type, then return type is accurately Promise<string | null>. So why can't I get it to return Promise<string>?
Promise<string>
generated code should return Promise<string>
See above description
See above
No response
Hey 👋 just wondering if there are any updates on this?
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
14.15.3
Amplify CLI Version
7.6.5
What operating system are you using?
mac
Amplify Categories
api
Amplify Commands
codegen
Describe the bug
Try this graphql query
The typescript codegen code produced will be:
But the type
UpdateDateQuery
won't be defined in API.service.tsIf I remove the exclamation mark in the AWSDateTime return type, then return type is accurately Promise<string | null>. So why can't I get it to return
Promise<string>
?Expected behavior
generated code should return
Promise<string>
Reproduction steps
See above description
GraphQL schema(s)
See above
Log output
Additional information
No response