Skip to content

How to respond with a server error? #68

@tniezurawski

Description

@tniezurawski

Hey folks 👋 I'm struggling with responding with a server error. I use the typical mirage way. Say, I want to simulate 502s and test Apollo's retry mechanism, so under some fake conditions I return this for a query:

return new Response(502);

But what I get returned instead is wrapped in GraphQL error. It looks like miragejs/graphql (or something internally) treats my response with 502 as a regular response and complains that the data is not returned properly:

image

Is it possible that miragejs/graphql is not aware that it should "re-throw" (pass) the error? Could someone give me pointers on where I should look to fill the gap?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions