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 for a method parameter that is an interface annotated with @ProjectedPayload.

By default, the projection is prepared by using the complete arguments map as its source. Add @Argument with a name, if you to prepare it by using a specific argument value instead as its source.

An @ProjectedPayload interface has accessor methods. In a closed projection, getter methods access underlying properties directly. In an open projection, getter methods make use of the @Value annotation to evaluate SpEL expressions against the underlying target object.

For example:

 @ProjectedPayload
 interface BookProjection {

   String getName();

   @Value("#{target.author + ' '  + target.name}")
   String getAuthorAndName();
 }
 
Since:
1.0.0
Author:
Mark Paluch, Rossen Stoyanchev