Skip to content

Commit

Permalink
Minor cleanup and simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Feb 14, 2024
1 parent e8035a8 commit 3d3393f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,10 @@ def same_arguments(
args1 = node1.arguments
args2 = node2.arguments

if args1 is None or len(args1) == 0:
return args2 is None or len(args2) == 0
if not args1:
return not args2

if args2 is None or len(args2) == 0:
if not args2:
return False

if len(args1) != len(args2):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@
graphql_sync,
)


schema = GraphQLSchema(
query=GraphQLObjectType(
name="Query",
fields={
"hello": GraphQLField(
GraphQLString,
resolve=lambda obj, info: "world",
resolve=lambda _obj, _info: "world",
)
},
)
)
source = "query {{ {fields} }}".format(fields="hello " * 250)
source = f"{{ {'hello ' * 250}}}"


def test_many_repeated_fields(benchmark):
print(source)
result = benchmark(lambda: graphql_sync(schema, source))
assert not result.errors
assert result == ({"hello": "world"}, None)
1 change: 1 addition & 0 deletions tests/execution/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ async def friend_list(_info):
]

@pytest.mark.asyncio()
@pytest.mark.filterwarnings("ignore:.* was never awaited:RuntimeWarning")
async def filters_stream_payloads_that_are_nulled_in_a_deferred_payload():
document = parse(
"""
Expand Down

0 comments on commit 3d3393f

Please sign in to comment.