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 @resolver directive 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 Detail

      • ResolverModel

        ResolverModel()
    • 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 resolve method.

        Example output: CompletableFuture<Profile>

        Returns:

        the CompletableFuture type wrapping the return type

      • getBatchResolveFutureType

         String getBatchResolveFutureType()

        Returns the return type for the batchResolve method.

        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 batchResolve method.

        Example output: List<Context>

        Returns:

        the List type containing Context instances