graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

SDK return types are misleading

Open nathanbrachotte opened this issue 11 months ago • 0 comments

Issue workflow progress

Progress of the issue based on the Contributor Workflow

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:

Reproduction

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

nathanbrachotte avatar Mar 25 '24 13:03 nathanbrachotte