Class ProjectedPayloadMethodArgumentResolver

java.lang.Object
org.springframework.graphql.data.method.annotation.support.ProjectedPayloadMethodArgumentResolver
All Implemented Interfaces:
HandlerMethodArgumentResolver

public class ProjectedPayloadMethodArgumentResolver extends Object implements HandlerMethodArgumentResolver
Resolver to obtain an @ProjectedPayload, either based on the complete DataFetchingEnvironment.getArguments() map, or based on a specific argument within the map when the method parameter is annotated with @Argument.

Projected payloads consist of the projection interface and accessor methods. Projections can be closed or open projections. Closed projections use interface getter methods to access underlying properties directly. Open projection methods make use of the @Value annotation to evaluate SpEL expressions against the underlying target object.

For example:

 @ProjectedPayload
 interface BookProjection {
   String getName();
 }

 @ProjectedPayload
 interface BookProjection {
   @Value("#{target.author + ' '  + target.name}")
   String getAuthorAndName();
 }
 
Since:
1.0.0
Author:
Mark Paluch