Polishing entity argument resolvers

Closes gh-996
This commit is contained in:
rstoyanchev
2024-06-26 15:26:16 +01:00
parent 8d8432db44
commit 89a4494148
2 changed files with 9 additions and 2 deletions

View File

@@ -96,6 +96,9 @@ final class EntityArgumentMethodArgumentResolver extends ArgumentMethodArgumentR
}
/**
* Wrap the DataFetchingEnvironment to also make the representation map available.
*/
static class EntityDataFetchingEnvironment extends DelegatingDataFetchingEnvironment {
private final Map<String, Object> representation;
@@ -111,6 +114,10 @@ final class EntityArgumentMethodArgumentResolver extends ArgumentMethodArgumentR
}
/**
* Wrap the DataFetchingEnvironment to also make representation maps available
* for batched invocations.
*/
static class EntityBatchDataFetchingEnvironment extends DelegatingDataFetchingEnvironment {
private final List<Map<String, Object>> representations;

View File

@@ -30,8 +30,8 @@ import org.springframework.graphql.data.method.HandlerMethodArgumentResolver;
import org.springframework.util.Assert;
/**
* Resolver for the representation map of an entity, or for all representations
* for the target schema type (batched handler methods).
* Resolver that exposes the raw representation input {@link Map},
* or {@link List} of maps for batched invocations.
*
* @author Rossen Stoyanchev
*/