Skip to content

[apollo-datasource-rest] Error thrown when parsing 204 response #2434

@EspadaV8

Description

@EspadaV8

We have a number of endpoints that return the 204 HTTP status code when handling DELETE requests. These are currently throwing an error because of the attempt to parse the body (

return (this.parseBody(response) as any) as Promise<TResult>;
), however, for these responses there isn't a body. To handle this I think that didReceiveResponse should check the status code before attempting to parse the body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions