public SchemaGeneratorHooks
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 | Interface and Description |
---|---|
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 |
---|---|
graphql.schema.DataFetcher<?> |
didGenerateDataFetcher(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
|
void |
didGenerateGraphQLType(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
|
graphql.schema.GraphQLFieldDefinition |
didGenerateMutationType(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
|
graphql.schema.GraphQLFieldDefinition |
didGenerateQueryType(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
|
DataFetcherExecutionPredicate |
getDataFetcherExecutionPredicate()
Execute a predicate on each function parameters after their deserialization
If the execution is unsuccessful the
onFailure method will be invoked |
boolean |
isValidFunction(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.
|
boolean |
isValidProperty(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.
|
graphql.schema.GraphQLType |
onRewireGraphQLType(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. |
graphql.schema.GraphQLSchema.Builder |
willBuildSchema(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
|
graphql.schema.GraphQLType |
willGenerateGraphQLType(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
|
kotlin.reflect.KType |
willResolveMonad(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.
|
graphql.schema.GraphQLSchema.Builder willBuildSchema(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
graphql.schema.GraphQLType willGenerateGraphQLType(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
kotlin.reflect.KType willResolveMonad(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.
boolean isValidProperty(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.
boolean isValidFunction(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.
graphql.schema.GraphQLType onRewireGraphQLType(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.
void didGenerateGraphQLType(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
graphql.schema.DataFetcher<?> didGenerateDataFetcher(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
graphql.schema.GraphQLFieldDefinition didGenerateQueryType(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
graphql.schema.GraphQLFieldDefinition didGenerateMutationType(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
DataFetcherExecutionPredicate getDataFetcherExecutionPredicate()
Execute a predicate on each function parameters after their deserialization
If the execution is unsuccessful the onFailure
method will be invoked