graphql-mesh
graphql-mesh copied to clipboard
SDK return types are misleading
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- [x] 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox
Make sure to fork this template and run
yarn generate
in the terminal.Please make sure Mesh package versions under
package.json
matches yours.
- [x] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review
Describe the bug Hey there 👋🏼
It seems like the generated QuerySdk
type doesn't have Error
in return type but it should?
This is error prone when we need to query from a specific API in additional resolvers. See the resolvers.ts
file example in repro.
To Reproduce Steps to reproduce the behavior:
Expected behavior
I'd either expect error in the underlying promise to throw an error, or an Error
type to always be there to force us to handle that scenario. Did I miss anything?
Environment:
- OS: n/a
- "@graphql-mesh/cli": "0.89.7", "@graphql-mesh/json-schema": "0.99.6", "@graphql-mesh/plugin-mock": "0.97.5", "@graphql-yoga/plugin-sofa": "3.2.0", "graphql": "16.8.1"
- NodeJS: n/a