Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ChilliCream/graphql-platform
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: ChilliCream/graphql-platform
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: tte/fix-fusion-queryplan-issue
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 3 commits
  • 43 files changed
  • 1 contributor

Commits on Feb 2, 2025

  1. Verified

    This commit was signed with the committer’s verified signature.
    tobias-tengler Tobias Tengler
    Copy the full SHA
    bd883a3 View commit details

Commits on Feb 3, 2025

  1. Add reproduction

    tobias-tengler committed Feb 3, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    tobias-tengler Tobias Tengler
    Copy the full SHA
    298f129 View commit details
  2. Apply fix

    tobias-tengler committed Feb 3, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    tobias-tengler Tobias Tengler
    Copy the full SHA
    0f55cda View commit details
Showing with 736 additions and 134 deletions.
  1. +4 −3 src/HotChocolate/Fusion/src/Core/Execution/Nodes/ResolveByKeyBatch.cs
  2. +42 −42 src/HotChocolate/Fusion/test/Core.Tests/AutomaticMockingTests.cs
  3. +217 −0 src/HotChocolate/Fusion/test/Core.Tests/DemoIntegrationTests.cs
  4. +173 −0 ...ore.Tests/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.md
  5. +183 −0 .../DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.md
  6. +3 −3 ...otChocolate/Fusion/test/Core.Tests/__snapshots__/SkipTests.ResolveByKey_Skip_On_SubField_False.md
  7. +3 −3 ...te/Fusion/test/Core.Tests/__snapshots__/SkipTests.ResolveByKey_Skip_On_SubField_Fragment_False.md
  8. +3 −3 ...ests/__snapshots__/SkipTests.ResolveByKey_Skip_On_SubField_Fragment_Other_Field_Selected_False.md
  9. +3 −3 ...ts/__snapshots__/SkipTests.ResolveByKey_Skip_On_SubField_Fragment_SubField_Selected_Separately.md
  10. +3 −3 ...st/Core.Tests/__snapshots__/SkipTests.ResolveByKey_Skip_On_SubField_Other_Field_Selected_False.md
  11. +3 −3 ...est/Core.Tests/__snapshots__/SkipTests.ResolveByKey_Skip_On_SubField_Other_Field_Selected_True.md
  12. +2 −2 ...olate/Fusion/test/Core.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_EntryField_False.md
  13. +2 −2 ...pshots__/SkipTests.Resolve_Sequence_Skip_On_EntryField_Fragment_EntryField_Selected_Separately.md
  14. +2 −2 ...ion/test/Core.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_EntryField_Fragment_False.md
  15. +2 −2 ..._snapshots__/SkipTests.Resolve_Sequence_Skip_On_EntryField_Fragment_Other_Field_Selected_False.md
  16. +2 −2 ...e.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_EntryField_Other_Field_Selected_False.md
  17. +1 −1 ...re.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_EntryField_Other_Field_Selected_True.md
  18. +1 −1 ...colate/Fusion/test/Core.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_EntryField_True.md
  19. +2 −2 ...colate/Fusion/test/Core.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_RootField_False.md
  20. +2 −2 ...sion/test/Core.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_RootField_Fragment_False.md
  21. +2 −2 ...apshots__/SkipTests.Resolve_Sequence_Skip_On_RootField_Fragment_Other_RootField_Selected_False.md
  22. +2 −2 ...ests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_RootField_Other_RootField_Selected_False.md
  23. +2 −2 ...ocolate/Fusion/test/Core.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_SubField_False.md
  24. +2 −2 ...usion/test/Core.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_SubField_Fragment_False.md
  25. +2 −2 .../__snapshots__/SkipTests.Resolve_Sequence_Skip_On_SubField_Fragment_Other_Field_Selected_False.md
  26. +2 −2 ..._snapshots__/SkipTests.Resolve_Sequence_Skip_On_SubField_Fragment_SubField_Selected_Separately.md
  27. +2 −2 ...ore.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_SubField_Other_Field_Selected_False.md
  28. +2 −2 ...Core.Tests/__snapshots__/SkipTests.Resolve_Sequence_Skip_On_SubField_Other_Field_Selected_True.md
  29. +2 −2 ...graphErrorTests.ResolveByKey_SubField_NonNull_ListItem_Nullable_Second_Service_Errors_SubField.md
  30. +3 −3 ...phErrorTests.ResolveByKey_SubField_Nullable_ListItem_Nullable_Second_Service_Errors_EntryField.md
  31. +3 −3 ...raphErrorTests.ResolveByKey_SubField_Nullable_ListItem_Nullable_Second_Service_Errors_SubField.md
  32. +3 −3 ...veByKey_SubField_Nullable_ListItem_Nullable_Second_Service_Returns_TopLevel_Error_Without_Data.md
  33. +1 −1 ...raphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.md
  34. +1 −1 ...bgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.md
  35. +1 −1 ...e_Sequence_SubField_NonNull_Parent_Nullable_Second_Service_Returns_TopLevel_Error_Without_Data.md
  36. +2 −2 ...aphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.md
  37. +2 −2 ...graphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.md
  38. +2 −2 ..._Sequence_SubField_Nullable_Parent_Nullable_Second_Service_Returns_TopLevel_Error_Without_Data.md
  39. +3 −3 ....Tests/__snapshots__/TransportErrorTests.ResolveByKey_Second_Service_Offline_SubField_Nullable.md
  40. +2 −2 ...sportErrorTests.Resolve_Sequence_Node_Second_Service_Offline_SubField_Nullable_Parent_Nullable.md
  41. +1 −1 ..._/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.md
  42. +2 −2 .../TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.md
  43. +39 −11 src/HotChocolate/Fusion/test/Shared/AutomaticMocking/MockFieldMiddleware.cs
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ protected override async Task OnExecuteAsync(
var batchExecutionState = CreateBatchBatchState(executionState, Requires);

// Create the batch subgraph request.
var variableValues = BuildVariables(batchExecutionState, _argumentTypes);
var variableValues = BuildVariables(batchExecutionState, Requires, _argumentTypes);
var request = CreateRequest(context.OperationContext.Variables, variableValues);

// Once we have the batch request, we will enqueue it for execution with
@@ -194,6 +194,7 @@ private void ProcessResult(

private static Dictionary<string, IValueNode> BuildVariables(
BatchExecutionState[] batchExecutionState,
string[] requires,
Dictionary<string, ITypeNode> argumentTypes)
{
var first = batchExecutionState[0];
@@ -220,7 +221,7 @@ private static Dictionary<string, IValueNode> BuildVariables(
batchState = ref Unsafe.Add(ref batchState, 1)!;
}

foreach (var key in first.VariableValues.Keys)
foreach (var key in requires)
{
var expectedType = argumentTypes[key];

@@ -240,7 +241,7 @@ private static Dictionary<string, IValueNode> BuildVariables(
}
else
{
if (batchExecutionState[0].VariableValues.TryGetValue(key, out var variableValue))
if (first.VariableValues.TryGetValue(key, out var variableValue))
{
variableValues.Add(key, variableValue);
}
84 changes: 42 additions & 42 deletions src/HotChocolate/Fusion/test/Core.Tests/AutomaticMockingTests.cs
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ type Object {
{
"data": {
"obj": {
"id": "1",
"id": "Object:1",
"str": "string"
}
}
@@ -177,15 +177,15 @@ type Object {
"data": {
"objs": [
{
"id": "1",
"id": "Object:1",
"str": "string"
},
{
"id": "2",
"id": "Object:2",
"str": "string"
},
{
"id": "3",
"id": "Object:3",
"str": "string"
}
]
@@ -234,29 +234,29 @@ type Object {
"data": {
"objsA": [
{
"id": "1",
"id": "Object:1",
"str": "string"
},
{
"id": "2",
"id": "Object:2",
"str": "string"
},
{
"id": "3",
"id": "Object:3",
"str": "string"
}
],
"objsB": [
{
"id": "4",
"id": "Object:4",
"str": "string"
},
{
"id": "5",
"id": "Object:5",
"str": "string"
},
{
"id": "6",
"id": "Object:6",
"str": "string"
}
]
@@ -298,11 +298,11 @@ type Object {
"data": {
"objs": [
{
"id": "1"
"id": "Object:1"
},
null,
{
"id": "3"
"id": "Object:3"
}
]
}
@@ -358,11 +358,11 @@ type Object {
"data": {
"objs": [
{
"id": "1"
"id": "Object:1"
},
null,
{
"id": "3"
"id": "Object:3"
}
]
}
@@ -529,7 +529,7 @@ ... on Object {
"data": {
"intrface": {
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string",
"num": 123
}
@@ -696,19 +696,19 @@ ... on Object {
"interfaces": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string",
"num": 123
},
{
"__typename": "Object",
"id": "2",
"id": "Object:2",
"str": "string",
"num": 123
},
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string",
"num": 123
}
@@ -876,14 +876,14 @@ ... on Object {
"interfaces": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string",
"num": 123
},
null,
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string",
"num": 123
}
@@ -954,14 +954,14 @@ ... on Object {
"interfaces": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string",
"num": 123
},
null,
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string",
"num": 123
}
@@ -1017,19 +1017,19 @@ ... on Object {
"interfaces": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string",
"num": 123
},
{
"__typename": "Object",
"id": "2",
"id": "Object:2",
"str": "string",
"num": null
},
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string",
"num": 123
}
@@ -1101,19 +1101,19 @@ ... on Object {
"interfaces": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string",
"num": 123
},
{
"__typename": "Object",
"id": "2",
"id": "Object:2",
"str": "string",
"num": null
},
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string",
"num": 123
}
@@ -1167,7 +1167,7 @@ ... on Object {
"data": {
"unon": {
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string"
}
}
@@ -1318,17 +1318,17 @@ ... on Object {
"unions": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string"
},
{
"__typename": "Object",
"id": "2",
"id": "Object:2",
"str": "string"
},
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string"
}
]
@@ -1480,13 +1480,13 @@ ... on Object {
"unions": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string"
},
null,
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string"
}
]
@@ -1551,13 +1551,13 @@ ... on Object {
"unions": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string"
},
null,
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string"
}
]
@@ -1607,17 +1607,17 @@ ... on Object {
"unions": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string"
},
{
"__typename": "Object",
"id": "2",
"id": "Object:2",
"str": null
},
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string"
}
]
@@ -1683,17 +1683,17 @@ ... on Object {
"unions": [
{
"__typename": "Object",
"id": "1",
"id": "Object:1",
"str": "string"
},
{
"__typename": "Object",
"id": "2",
"id": "Object:2",
"str": null
},
{
"__typename": "Object",
"id": "3",
"id": "Object:3",
"str": "string"
}
]
Loading