NodeResolverFor

Annotation used to mark generated node resolver base classes in the Java API.

This is the Java equivalent of Kotlin's @NodeResolverFor annotation. It indicates which GraphQL Node type this resolver base class corresponds to.

Node resolvers handle resolution of types implementing the GraphQL Node interface, which requires a globally unique id field. These resolvers fetch node data by global ID.

Example generated code:


= "User")
public abstract class UserNodeResolverBase
    implements NodeResolverBase<User> {
  // Generated methods
}

Tenant implementation:



public class UserNodeResolver extends UserNodeResolverBase {
  
  public CompletableFuture<User> resolve(NodeContext<User> ctx) {
    String internalId = ctx.getId().getInternalID();
    return userService.fetchById(internalId);
  }
}

Functions

Link copied to clipboard
abstract fun isBatching(): Boolean
Whether the resolver handles resolution in batch mode.
Link copied to clipboard
abstract fun isSelective(): Boolean
Whether this resolver is selective (varies its response based on the selection set).
Link copied to clipboard
abstract fun typeName(): String
The GraphQL type name that implements the Node interface.