Fix handling of errors in cypress tests

This commit is contained in:
Ramon Wenger 2022-10-17 16:26:30 +02:00
parent 442a50e29d
commit a7ad48f34b
1 changed files with 8 additions and 10 deletions

View File

@ -161,16 +161,14 @@ Cypress.Commands.add('mockGraphql', (options?: any) => {
rootValue.constructor === GraphQLError ||
rootValue.constructor.name === "GraphQLError"
) {
return Promise.resolve()
.then(
() =>
new Response(
JSON.stringify({
data: {},
errors: [rootValue]
})
)
);
return req.reply(
{
body: {
data: {},
errors: [rootValue]
}
}
);
}
graphql({