Skip to content

@Valid arguments and a Principal argument cannot both be declared on the same method #289

Closed
@koenpunt

Description

@koenpunt

A mutation being defined like this;

@MutationMapping
suspend fun checkoutCart(
    @Argument cartId: ID,
    @Argument selectedAppointmentId: ID,
    @Valid @Argument customerDetails: CustomerDetailsInput?,
    principal: Principal?
): CheckoutCartPayload {

Fails with an error when called;

HV000163: The actual parameter type 'reactor.core.publisher.MonoMapFuseable' is not assignable to the expected one 'class oopen.timemachine.auth.Principal' for parameter 3 of 'CartMutation#checkoutCart(ID, ID, CustomerDetailsInput, Principal, Continuation)

Removing the @Valid annotation from the customerDetails argument causes the mutation to succeed again.

Note: oopen.timemachine.auth.Principal extends from org.springframework.security.authentication.AbstractAuthenticationToken

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions