public static class SchemaGeneratorHooks.DefaultImpls
Collection of all the hooks when generating a schema. Hooks are lifecycle events that are called and triggered while the schema is building that allow users to customize the schema.
Modifier and Type | Method and Description |
---|---|
static graphql.schema.DataFetcher<?> |
didGenerateDataFetcher(SchemaGeneratorHooks $this,
kotlin.reflect.KFunction<?> function,
graphql.schema.DataFetcher<?> dataFetcher)
Called after converting the function to a data fetcher allowing wrapping the fetcher to modify data or instrument it.
This is more useful than the graphql.execution.instrumentation.Instrumentation as you have the function type here
|
static void |
didGenerateGraphQLType(SchemaGeneratorHooks $this,
kotlin.reflect.KType type,
graphql.schema.GraphQLType generatedType)
Called after wrapping the type based on nullity but before adding the generated type to the schema
|
static graphql.schema.GraphQLFieldDefinition |
didGenerateMutationType(SchemaGeneratorHooks $this,
kotlin.reflect.KFunction<?> function,
graphql.schema.GraphQLFieldDefinition fieldDefinition)
Called after converting the function to a field definition but before adding to the schema to allow customization
|
static graphql.schema.GraphQLFieldDefinition |
didGenerateQueryType(SchemaGeneratorHooks $this,
kotlin.reflect.KFunction<?> function,
graphql.schema.GraphQLFieldDefinition fieldDefinition)
Called after converting the function to a field definition but before adding to the schema to allow customization
|
static DataFetcherExecutionPredicate |
getDataFetcherExecutionPredicate(SchemaGeneratorHooks $this)
Execute a predicate on each function parameters after their deserialization
If the execution is unsuccessful the
onFailure method will be invoked |
static boolean |
isValidFunction(SchemaGeneratorHooks $this,
kotlin.reflect.KFunction<?> function)
Called when looking at the KClass functions to determine if it valid for adding to the generated schema.
If any filter returns false, it is rejected.
|
static boolean |
isValidProperty(SchemaGeneratorHooks $this,
kotlin.reflect.KProperty<?> property)
Called when looking at the KClass properties to determine if it valid for adding to the generated schema.
If any filter returns false, it is rejected.
|
static graphql.schema.GraphQLType |
onRewireGraphQLType(SchemaGeneratorHooks $this,
kotlin.reflect.KType type,
graphql.schema.GraphQLType generatedType)
Called after
willGenerateGraphQLType and before didGenerateGraphQLType .
Enables you to change the wiring, e.g. directives to alter data fetchers. |
static graphql.schema.GraphQLSchema.Builder |
willBuildSchema(SchemaGeneratorHooks $this,
graphql.schema.GraphQLSchema.Builder builder)
Called before the final GraphQL schema is built.
This doesn't prevent the called from rebuilding the final schema using java-graphql's functionality
|
static graphql.schema.GraphQLType |
willGenerateGraphQLType(SchemaGeneratorHooks $this,
kotlin.reflect.KType type)
Called before using reflection to generate the graphql object type for the given KType.
This allows supporting objects that the caller does not want to use reflection on for special handling
|
static kotlin.reflect.KType |
willResolveMonad(SchemaGeneratorHooks $this,
kotlin.reflect.KType type)
Called before resolving a Monad or Future type to its wrapped KType.
This allows for a custom resolver on how to extract the wrapped value.
|
public static graphql.schema.GraphQLSchema.Builder willBuildSchema(SchemaGeneratorHooks $this, graphql.schema.GraphQLSchema.Builder builder)
Called before the final GraphQL schema is built. This doesn't prevent the called from rebuilding the final schema using java-graphql's functionality
public static graphql.schema.GraphQLType willGenerateGraphQLType(SchemaGeneratorHooks $this, kotlin.reflect.KType type)
Called before using reflection to generate the graphql object type for the given KType. This allows supporting objects that the caller does not want to use reflection on for special handling
public static kotlin.reflect.KType willResolveMonad(SchemaGeneratorHooks $this, kotlin.reflect.KType type)
Called before resolving a Monad or Future type to its wrapped KType. This allows for a custom resolver on how to extract the wrapped value.
public static boolean isValidProperty(SchemaGeneratorHooks $this, kotlin.reflect.KProperty<?> property)
Called when looking at the KClass properties to determine if it valid for adding to the generated schema. If any filter returns false, it is rejected.
public static boolean isValidFunction(SchemaGeneratorHooks $this, kotlin.reflect.KFunction<?> function)
Called when looking at the KClass functions to determine if it valid for adding to the generated schema. If any filter returns false, it is rejected.
public static graphql.schema.GraphQLType onRewireGraphQLType(SchemaGeneratorHooks $this, kotlin.reflect.KType type, graphql.schema.GraphQLType generatedType)
Called after willGenerateGraphQLType
and before didGenerateGraphQLType
.
Enables you to change the wiring, e.g. directives to alter data fetchers.
public static void didGenerateGraphQLType(SchemaGeneratorHooks $this, kotlin.reflect.KType type, graphql.schema.GraphQLType generatedType)
Called after wrapping the type based on nullity but before adding the generated type to the schema
public static graphql.schema.DataFetcher<?> didGenerateDataFetcher(SchemaGeneratorHooks $this, kotlin.reflect.KFunction<?> function, graphql.schema.DataFetcher<?> dataFetcher)
Called after converting the function to a data fetcher allowing wrapping the fetcher to modify data or instrument it. This is more useful than the graphql.execution.instrumentation.Instrumentation as you have the function type here
public static graphql.schema.GraphQLFieldDefinition didGenerateQueryType(SchemaGeneratorHooks $this, kotlin.reflect.KFunction<?> function, graphql.schema.GraphQLFieldDefinition fieldDefinition)
Called after converting the function to a field definition but before adding to the schema to allow customization
public static graphql.schema.GraphQLFieldDefinition didGenerateMutationType(SchemaGeneratorHooks $this, kotlin.reflect.KFunction<?> function, graphql.schema.GraphQLFieldDefinition fieldDefinition)
Called after converting the function to a field definition but before adding to the schema to allow customization
public static DataFetcherExecutionPredicate getDataFetcherExecutionPredicate(SchemaGeneratorHooks $this)
Execute a predicate on each function parameters after their deserialization
If the execution is unsuccessful the onFailure
method will be invoked