Skip to content

Commit cf79552

Browse files
committed
Fix typo in the error message for max tokens
Replicates graphql/graphql-js@d1c83e0
1 parent e34f020 commit cf79552

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/graphql/language/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ def advance_lexer(self) -> None:
12531253
raise GraphQLSyntaxError(
12541254
self._lexer.source,
12551255
token.start,
1256-
f"Document contains more that {max_tokens} tokens."
1256+
f"Document contains more than {max_tokens} tokens."
12571257
" Parsing aborted.",
12581258
)
12591259

tests/language/test_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,19 @@ def parse_provides_useful_error_when_using_source():
113113
"""
114114
)
115115

116-
def limits_maximum_number_of_tokens():
116+
def limits_by_a_maximum_number_of_tokens():
117117
parse("{ foo }", max_tokens=3)
118118
with pytest.raises(
119119
GraphQLSyntaxError,
120120
match="Syntax Error:"
121-
r" Document contains more that 2 tokens\. Parsing aborted\.",
121+
r" Document contains more than 2 tokens\. Parsing aborted\.",
122122
):
123123
parse("{ foo }", max_tokens=2)
124124
parse('{ foo(bar: "baz") }', max_tokens=8)
125125
with pytest.raises(
126126
GraphQLSyntaxError,
127127
match="Syntax Error:"
128-
r" Document contains more that 7 tokens\. Parsing aborted\.",
128+
r" Document contains more than 7 tokens\. Parsing aborted\.",
129129
):
130130
parse('{ foo(bar: "baz") }', max_tokens=7)
131131

0 commit comments

Comments
 (0)