Skip to content

Commit 4bc71ee

Browse files
committed
perf(handler): Detect non-string query parameter before parsing
1 parent c0a08c7 commit 4bc71ee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/handler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ export function createHandler<RawRequest = unknown>(
335335
}
336336

337337
if (!partParams.query) throw new Error('Missing query');
338+
if (typeof partParams.query !== 'string')
339+
throw new Error('Invalid query');
338340
if (
339341
partParams.variables != null &&
340342
(typeof partParams.variables !== 'object' ||

0 commit comments

Comments
 (0)