Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK return types are misleading #6735

Open
2 of 4 tasks
nathanbrachotte opened this issue Mar 25, 2024 · 0 comments
Open
2 of 4 tasks

SDK return types are misleading #6735

nathanbrachotte opened this issue Mar 25, 2024 · 0 comments

Comments

@nathanbrachotte
Copy link

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.

  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant