diff --git a/graphql/language/tests/fixtures.py b/graphql/language/tests/fixtures.py index b16653c4..74b2ccda 100644 --- a/graphql/language/tests/fixtures.py +++ b/graphql/language/tests/fixtures.py @@ -53,7 +53,7 @@ } { - unnamed(truthy: true, falsey: false), + unnamed(truthy: true, falsey: false, nullish: null), query } """ diff --git a/graphql/language/tests/test_parser.py b/graphql/language/tests/test_parser.py index 7d587db8..ad251213 100644 --- a/graphql/language/tests/test_parser.py +++ b/graphql/language/tests/test_parser.py @@ -90,11 +90,8 @@ def test_does_not_accept_fragments_spread_of_on(): assert 'Syntax Error GraphQL (1:9) Expected Name, found }' in excinfo.value.message -def test_does_not_allow_null_value(): - with raises(GraphQLSyntaxError) as excinfo: - parse('{ fieldWithNullableStringInput(input: null) }') - - assert 'Syntax Error GraphQL (1:39) Unexpected Name "null"' in excinfo.value.message +def test_allows_null_value(): + parse('{ fieldWithNullableStringInput(input: null) }') def test_parses_multi_byte_characters(): @@ -130,7 +127,8 @@ def tesst_allows_non_keywords_anywhere_a_name_is_allowed(): 'mutation', 'subscription', 'true', - 'false' + 'false', + 'null', ] query_template = ''' diff --git a/graphql/language/tests/test_printer.py b/graphql/language/tests/test_printer.py index 5d8ce7ea..ca4a6375 100644 --- a/graphql/language/tests/test_printer.py +++ b/graphql/language/tests/test_printer.py @@ -118,7 +118,7 @@ def test_prints_kitchen_sink(): } { - unnamed(truthy: true, falsey: false) + unnamed(truthy: true, falsey: false, nullish: null) query } ''' diff --git a/graphql/language/tests/test_visitor.py b/graphql/language/tests/test_visitor.py index 5ede5294..85f24d5e 100644 --- a/graphql/language/tests/test_visitor.py +++ b/graphql/language/tests/test_visitor.py @@ -562,6 +562,12 @@ def leave(self, node, key, parent, *args): ['enter', 'BooleanValue', 'value', 'Argument'], ['leave', 'BooleanValue', 'value', 'Argument'], ['leave', 'Argument', 1, None], + ['enter', 'Argument', 2, None], + ['enter', 'Name', 'name', 'Argument'], + ['leave', 'Name', 'name', 'Argument'], + ['enter', 'NullValue', 'value', 'Argument'], + ['leave', 'NullValue', 'value', 'Argument'], + ['leave', 'Argument', 2, None], ['leave', 'Field', 0, None], ['enter', 'Field', 1, None], ['enter', 'Name', 'name', 'Field'],