Class ResolverModel
-
- All Implemented Interfaces:
public final class ResolverModel extends Record
Model representing a GraphQL field resolver for code generation.
Each resolver model corresponds to a field annotated with
@resolverdirective in the GraphQL schema. The generated class will be an abstract base class that tenant developers extend to implement field resolution logic.Example GraphQL schema:
type User { profile: Profile @resolver }This would generate a resolver model with:
gqlTypeName = "User"gqlFieldName = "profile"resolverClassName = "Profile"returnType = "Profile"
-
-
Constructor Summary
Constructors Constructor Description ResolverModel()
-
Method Summary
Modifier and Type Method Description StringgetGqlTypeName()Returns the GraphQL type name containing this resolver field. StringgetGqlFieldName()Returns the GraphQL field name for this resolver. StringgetResolverClassName()Returns the Java class name for the generated resolver. StringgetReturnType()Returns the Java return type for the resolve method. StringgetObjectType()Returns the fully qualified Java type of the parent object. StringgetQueryType()Returns the fully qualified Java type for the Query root. StringgetArgumentsType()Returns the fully qualified Java type for field arguments. StringgetSelectionsType()Returns the fully qualified Java type for field selections. booleangetHasArguments()Returns whether the GraphQL field has arguments. booleangetIsCompositeOutput()Returns whether the return type is a composite GraphQL type. booleangetIncludeBatchResolve()Returns whether to generate the batchResolve method. StringgetFieldResolverBaseType()Returns the complete generic type signature for FieldResolverBase.StringgetContextBaseType()Returns the complete generic type signature for FieldResolverBase.Context.StringgetFieldExecutionContextType()Returns the complete generic type signature for FieldExecutionContext.StringgetResolveFutureType()Returns the return type for the single-item resolvemethod.StringgetBatchResolveFutureType()Returns the return type for the batchResolvemethod.StringgetBatchResolveContextListType()Returns the parameter type for the batchResolvemethod.-
-
Method Detail
-
getGqlTypeName
String getGqlTypeName()
Returns the GraphQL type name containing this resolver field.
- Returns:
the GraphQL type name (e.g., "User", "Query")
-
getGqlFieldName
String getGqlFieldName()
Returns the GraphQL field name for this resolver.
- Returns:
the field name (e.g., "profile", "orders")
-
getResolverClassName
String getResolverClassName()
Returns the Java class name for the generated resolver.
- Returns:
the resolver class name (e.g., "Profile", "Orders")
-
getReturnType
String getReturnType()
Returns the Java return type for the resolve method.
- Returns:
the return type (e.g., "Profile", "List<Order>", "String")
-
getObjectType
String getObjectType()
Returns the fully qualified Java type of the parent object.
- Returns:
the object type (e.g., "com.example.types.User")
-
getQueryType
String getQueryType()
Returns the fully qualified Java type for the Query root.
- Returns:
the query type (e.g., "com.example.types.Query")
-
getArgumentsType
String getArgumentsType()
Returns the fully qualified Java type for field arguments.
- Returns:
the arguments type (e.g., "Arguments.NoArguments" or a generated arguments class)
-
getSelectionsType
String getSelectionsType()
Returns the fully qualified Java type for field selections.
- Returns:
the selections type (e.g., "com.example.types.Profile" or "CompositeOutput.NotComposite")
-
getHasArguments
boolean getHasArguments()
Returns whether the GraphQL field has arguments.
- Returns:
true if the field has arguments, false otherwise
-
getIsCompositeOutput
boolean getIsCompositeOutput()
Returns whether the return type is a composite GraphQL type.
- Returns:
true if the return type is an object/interface, false if scalar
-
getIncludeBatchResolve
boolean getIncludeBatchResolve()
Returns whether to generate the batchResolve method.
- Returns:
true to include batchResolve, false to omit (e.g., for Mutation fields)
-
getFieldResolverBaseType
String getFieldResolverBaseType()
Returns the complete generic type signature for
FieldResolverBase.Example output:
FieldResolverBase<Profile, com.example.types.User, com.example.types.Query, Arguments.NoArguments, com.example.types.Profile>- Returns:
the FieldResolverBase type with all type parameters
-
getContextBaseType
String getContextBaseType()
Returns the complete generic type signature for
FieldResolverBase.Context.Example output:
FieldResolverBase.Context<com.example.types.User, com.example.types.Query, Arguments.NoArguments, com.example.types.Profile>- Returns:
the Context interface type with all type parameters
-
getFieldExecutionContextType
String getFieldExecutionContextType()
Returns the complete generic type signature for
FieldExecutionContext.Example output:
FieldExecutionContext<com.example.types.User, com.example.types.Query, Arguments.NoArguments, com.example.types.Profile>- Returns:
the FieldExecutionContext type with all type parameters
-
getResolveFutureType
String getResolveFutureType()
Returns the return type for the single-item
resolvemethod.Example output:
CompletableFuture<Profile>- Returns:
the CompletableFuture type wrapping the return type
-
getBatchResolveFutureType
String getBatchResolveFutureType()
Returns the return type for the
batchResolvemethod.Example output:
CompletableFuture<Map<Context, Profile>>- Returns:
the CompletableFuture type wrapping a Map from Context to return type
-
getBatchResolveContextListType
String getBatchResolveContextListType()
Returns the parameter type for the
batchResolvemethod.Example output:
List<Context>- Returns:
the List type containing Context instances
-
-
-
-