Open Nicktho opened 2 years ago
I was searching for the exact same thing. @Nicktho Did you define a custom graphql type?
We have published an RFC on our plan for improving TypeScript support in Amplify JS & would love to get your feedback & suggestions!
With the release of the latest major version of Amplify (aws-amplify@>6), this issue should now be resolved! Please refer to our release announcement, migration guide, and documentation for more information.
re-opening as this is still an issue
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
Describe the bug
API.graphql()
return type isPromise<GraphQLResult> | Observable<object>
.Although, when using
amplify
theerrors
object on aGraphQLResult
does not conform to the typeGraphQLError[]
as defined byGraphQLResult
.The following properties exist on the
errors
object that are not in the type :errorInfo
,errorType
.Expected behavior
I expect the type returned by
API.graphql()
to allow the addition of theerrorInfo
anderrorType
attributes so that I can act on them in a typescript project using amplify.Reproduction steps
aws-amplify
API
fromaws-amplify
graphql
and try to act onerrorInfo
anderrorType
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response