Skip to content

useQuery shouldThrowError does not work #2456

@oliverbenns

Description

@oliverbenns

openapi-typescript version

7.9.1

Node.js version

23.11.0

OS + version

macOS 15.6

Description

shouldThrowError does not seem to throw an error. Even with retry option set to false.

Also it looks like query options should be a fourth parameter according to the documentation, but the 3rd query parameter also allows the types for the options. Regardless, neither seem to respect it.

Reproduction

Create a client, set options to retry: false, showThrownOnError: true.
Have an api return a 500, or pass in a fetch client that rejects a promise to the constructor.

Expected result

Error is thrown, error boundary if provided should pick up.

Required

  • My OpenAPI schema is valid and passes the Redocly validator (npx @redocly/cli@latest lint)

Extra

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-tsRelevant to the openapi-typescript library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions