Skip to content

openapi-react-query does not handle the server returning null #2000

Closed
@gaborbernat

Description

@gaborbernat

When the server returns null (which is a valid thing, because e.g. has no payload to send) openapi-react-query handles that as an error, even though the server returned with 200.

The reason behind this is https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-react-query/src/index.ts#L118-L121, here this should be:

    if (error || data === undefined) {
      throw error;
    }
    return data;

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions