Skip to content

Commit

Permalink
remove unnecessary duplicated fields from defer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Apr 7, 2024
1 parent 7f4f04d commit 154ab12
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/execution/test_defer.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ async def can_defer_fragments_containing_scalar_types():
}
}
fragment NameFragment on Hero {
id
name
}
"""
Expand All @@ -359,9 +358,7 @@ async def can_defer_fragments_containing_scalar_types():
assert result == [
{"data": {"hero": {"id": "1"}}, "hasNext": True},
{
"incremental": [
{"data": {"id": "1", "name": "Luke"}, "path": ["hero"]}
],
"incremental": [{"data": {"name": "Luke"}, "path": ["hero"]}],
"hasNext": False,
},
]
Expand Down Expand Up @@ -507,12 +504,11 @@ async def can_defer_a_fragment_within_an_already_deferred_fragment():
"""
query HeroNameQuery {
hero {
id
...TopFragment @defer(label: "DeferTop")
}
}
fragment TopFragment on Hero {
name
id
...NestedFragment @defer(label: "DeferNested")
}
fragment NestedFragment on Hero {
Expand All @@ -525,7 +521,7 @@ async def can_defer_a_fragment_within_an_already_deferred_fragment():
result = await complete(document)

assert result == [
{"data": {"hero": {"id": "1"}}, "hasNext": True},
{"data": {"hero": {}}, "hasNext": True},
{
"incremental": [
{
Expand All @@ -540,7 +536,7 @@ async def can_defer_a_fragment_within_an_already_deferred_fragment():
"label": "DeferNested",
},
{
"data": {"name": "Luke"},
"data": {"id": "1"},
"path": ["hero"],
"label": "DeferTop",
},
Expand All @@ -555,7 +551,6 @@ async def can_defer_a_fragment_that_is_also_not_deferred_with_deferred_first():
"""
query HeroNameQuery {
hero {
id
...TopFragment @defer(label: "DeferTop")
...TopFragment
}
Expand All @@ -568,7 +563,7 @@ async def can_defer_a_fragment_that_is_also_not_deferred_with_deferred_first():
result = await complete(document)

assert result == [
{"data": {"hero": {"id": "1", "name": "Luke"}}, "hasNext": True},
{"data": {"hero": {"name": "Luke"}}, "hasNext": True},
{
"incremental": [
{
Expand All @@ -587,7 +582,6 @@ async def can_defer_a_fragment_that_is_also_not_deferred_with_non_deferred_first
"""
query HeroNameQuery {
hero {
id
...TopFragment
...TopFragment @defer(label: "DeferTop")
}
Expand All @@ -600,7 +594,7 @@ async def can_defer_a_fragment_that_is_also_not_deferred_with_non_deferred_first
result = await complete(document)

assert result == [
{"data": {"hero": {"id": "1", "name": "Luke"}}, "hasNext": True},
{"data": {"hero": {"name": "Luke"}}, "hasNext": True},
{
"incremental": [
{
Expand Down

0 comments on commit 154ab12

Please sign in to comment.