Skip to content

Argument annotations are ignored on handler methods in generic interfaces #1469

@bclozel

Description

@bclozel

When defining a GraphQL handler method in a generic interface, @Argument annotations on its parameters are not correctly detected by the framework if the interface is implemented by a concrete class (especially when bridging methods are involved).

See the following:

interface UserController<A, B> {
  User fetchUser(@Argument A arg1, @Argument B arg2);
}

abstract class AbstractUserController<C> implements UserController<Long, C> {
  @Override
  public User fetchUser(Long arg1, C arg2) {
  }
}

class ConcreteUserController extends AbstractUserController<String> {
}

When resolving the handler method for ConcreteUserController, the framework fails to find the @Argument annotations on the parameters.
The root cause appears to be in HandlerMethod bridged method matching logic, because it fails to match the erased types of the bridged method.

Metadata

Metadata

Assignees

Labels

in: coreIssues related to config and core supportstatus: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions