Interface SchemaDirectiveWiring
-
@PublicApi public interface SchemaDirectiveWiring
A SchemaDirectiveWiring is responsible for enhancing a runtime element based on directives placed on that element in the Schema Definition Language (SDL).It can enhance the graphql runtime element and add new behaviour for example by changing the fields
DataFetcher
The SchemaDirectiveWiring objects are called in a specific order based on registration:
RuntimeWiring.Builder.directive(String, SchemaDirectiveWiring)
which work against a specific named directive are called firstRuntimeWiring.Builder.directiveWiring(SchemaDirectiveWiring)
which work against all directives are called nextWiringFactory.providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment)
which work against all directives are called last
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default GraphQLArgument
onArgument(SchemaDirectiveWiringEnvironment<GraphQLArgument> environment)
This is called when an argument is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLEnumType
onEnum(SchemaDirectiveWiringEnvironment<GraphQLEnumType> environment)
This is called when an enum is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLEnumValueDefinition
onEnumValue(SchemaDirectiveWiringEnvironment<GraphQLEnumValueDefinition> environment)
This is called when an enum value is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLFieldDefinition
onField(SchemaDirectiveWiringEnvironment<GraphQLFieldDefinition> environment)
This is called when a field is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLInputObjectField
onInputObjectField(SchemaDirectiveWiringEnvironment<GraphQLInputObjectField> environment)
This is called when an input object field is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLInputObjectType
onInputObjectType(SchemaDirectiveWiringEnvironment<GraphQLInputObjectType> environment)
This is called when an input object is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLInterfaceType
onInterface(SchemaDirectiveWiringEnvironment<GraphQLInterfaceType> environment)
This is called when an interface is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLObjectType
onObject(SchemaDirectiveWiringEnvironment<GraphQLObjectType> environment)
This is called when an object is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLScalarType
onScalar(SchemaDirectiveWiringEnvironment<GraphQLScalarType> environment)
This is called when a custom scalar is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementdefault GraphQLUnionType
onUnion(SchemaDirectiveWiringEnvironment<GraphQLUnionType> environment)
This is called when a union is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL element
-
-
-
Method Detail
-
onObject
default GraphQLObjectType onObject(SchemaDirectiveWiringEnvironment<GraphQLObjectType> environment)
This is called when an object is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementThe
onArgument(SchemaDirectiveWiringEnvironment)
andonField(SchemaDirectiveWiringEnvironment)
callbacks will have been invoked for this element beforehand- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onField
default GraphQLFieldDefinition onField(SchemaDirectiveWiringEnvironment<GraphQLFieldDefinition> environment)
This is called when a field is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementThe
onArgument(SchemaDirectiveWiringEnvironment)
callbacks will have been invoked for this element beforehand- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onArgument
default GraphQLArgument onArgument(SchemaDirectiveWiringEnvironment<GraphQLArgument> environment)
This is called when an argument is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL element- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onInterface
default GraphQLInterfaceType onInterface(SchemaDirectiveWiringEnvironment<GraphQLInterfaceType> environment)
This is called when an interface is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementThe
onArgument(SchemaDirectiveWiringEnvironment)
andonField(SchemaDirectiveWiringEnvironment)
callbacks will have been invoked for this element beforehand- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onUnion
default GraphQLUnionType onUnion(SchemaDirectiveWiringEnvironment<GraphQLUnionType> environment)
This is called when a union is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL element- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onEnum
default GraphQLEnumType onEnum(SchemaDirectiveWiringEnvironment<GraphQLEnumType> environment)
This is called when an enum is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementThe
onEnumValue(SchemaDirectiveWiringEnvironment)
callbacks will have been invoked for this element beforehand- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onEnumValue
default GraphQLEnumValueDefinition onEnumValue(SchemaDirectiveWiringEnvironment<GraphQLEnumValueDefinition> environment)
This is called when an enum value is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL element- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onScalar
default GraphQLScalarType onScalar(SchemaDirectiveWiringEnvironment<GraphQLScalarType> environment)
This is called when a custom scalar is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL element- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onInputObjectType
default GraphQLInputObjectType onInputObjectType(SchemaDirectiveWiringEnvironment<GraphQLInputObjectType> environment)
This is called when an input object is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL elementThe
onInputObjectField(SchemaDirectiveWiringEnvironment)
callbacks will have been invoked for this element beforehand- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
onInputObjectField
default GraphQLInputObjectField onInputObjectField(SchemaDirectiveWiringEnvironment<GraphQLInputObjectField> environment)
This is called when an input object field is encountered, which gives the schema directive a chance to modify the shape and behaviour of that DSL element- Parameters:
environment
- the wiring element- Returns:
- a non null element based on the original one
-
-