Interface SchemaDirectiveWiring
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
Modifier and TypeMethodDescriptiondefault 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
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
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
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 Details
-
onObject
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
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
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
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
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
-