Skip to content

Commit 4c91e1c

Browse files
committed
refactor: cannot perform mutation over get as graphql error response
1 parent ae8ea29 commit 4c91e1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,9 @@ export function createHandler<RawRequest = unknown>(
426426
// https://graphql.github.io/graphql-over-http/draft/#sel-CALFJRPAAELBAAxwP
427427
if (operation === 'mutation' && method === 'GET') {
428428
return [
429-
'Cannot perform mutations over GET',
429+
JSON.stringify({
430+
errors: [new GraphQLError('Cannot perform mutations over GET')],
431+
}),
430432
{
431433
status: 405,
432434
statusText: 'Method Not Allowed',

0 commit comments

Comments
 (0)