Skip to content

Commit 77342de

Browse files
committed
Added extra validation
1 parent ff08d18 commit 77342de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/graphql_server/runtime.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ def _parse_and_validate(
163163
# async with extensions_runner.parsing():
164164
if not query:
165165
raise GraphQLError("No GraphQL query found in the request")
166+
elif not isinstance(query, str) and not isinstance(query, DocumentNode):
167+
raise GraphQLError(
168+
f"Provided GraphQL query must be a string or DocumentNode, got {type(query)}"
169+
)
166170

167171
try:
168172
if isinstance(query, str):

0 commit comments

Comments
 (0)