Tweak tests a little
@@ -4,7 +4,7 @@ from graphql.error import GraphQLSyntaxError
from ariadne import gql
-def test_valid_graphqll_string_is_passed_as_is():
+def test_valid_graphql_schema_string_is_returned_unchanged():
sdl = """
type User {
username: String!
@@ -14,7 +14,7 @@ def test_valid_graphqll_string_is_passed_as_is():
assert sdl == result
-def test_invalid_graphql_string_raises_syntax_error():
+def test_invalid_graphql_schema_string_causes_syntax_error():
with pytest.raises(GraphQLSyntaxError):
gql(
"""
@@ -23,3 +23,32 @@ def test_invalid_graphql_string_raises_syntax_error():
}
"""
)
+
+
+def test_valid_graphql_query_string_is_returned_unchanged():
+ query = """
+ query TestQuery {
+ auth
+ users {
+ id
+ username
+ }
+ }
+ """
+ result = gql(query)
+ assert query == result
+
+
+def test_invalid_graphql_query_string_causes_syntax_error():
+ with pytest.raises(GraphQLSyntaxError):
+ gql(
+ """
+ query TestQuery {
+ auth
+ users
+ id
+ username
+ }
+ }
+ """
+ )
\ No newline at end of file
