Skip to content

Commit

Permalink
Merge pull request #460 from faizan-siddiqui/add-path-to-hydrated-fie…
Browse files Browse the repository at this point in the history
…ld-serviceexecutionhydrationdetails

add fieldPath to ServiceExecutionHydrationDetails
  • Loading branch information
faizan-siddiqui authored Sep 15, 2023
2 parents 73a449f + 5b37fb6 commit 01e3e88
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ data class ServiceExecutionHydrationDetails(
val hydrationSourceService: Service,
val hydrationSourceField: FieldCoordinates,
val hydrationActorField: FieldCoordinates,
val fieldPath: List<String>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ internal class NadelHydrationTransform(
batchSize = 1,
hydrationSourceService = hydrationSourceService,
hydrationSourceField = instruction.location,
hydrationActorField = hydrationActorField
hydrationActorField = hydrationActorField,
fieldPath = fieldToHydrate.listOfResultKeys
)
engine.executeTopLevelField(
service = instruction.actorService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ internal class NadelBatchHydrator(
batchSize = instruction.batchSize,
hydrationSourceService = hydrationSourceService,
hydrationSourceField = instruction.location,
hydrationActorField = hydrationActorField
hydrationActorField = hydrationActorField,
fieldPath = state.hydratedField.listOfResultKeys,
)
engine.executeTopLevelField(
service = instruction.actorService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class `basic-hydration` : HydrationDetailsHook() {
assert(actualHydrationDetails.hydrationActorField.toString() == "Query.barById")
assert(actualHydrationDetails.hydrationSourceField.toString() == "Foo.bar")
assert(actualHydrationDetails.hydrationSourceService.name == "service1")
assert(actualHydrationDetails.fieldPath.toString() == "[foo, bar]")
}
}
@UseHook
Expand All @@ -34,5 +35,6 @@ class `batch-hydration-with-renamed-actor-field` : HydrationDetailsHook() {
assert(actualHydrationDetails.hydrationActorField.toString() == "Query.barsByIdOverall")
assert(actualHydrationDetails.hydrationSourceField.toString() == "Foo.bar")
assert(actualHydrationDetails.hydrationSourceService.name == "service1")
assert(actualHydrationDetails.fieldPath.toString() == "[foo, bar]")
}
}

0 comments on commit 01e3e88

Please sign in to comment.