Package graphql.schema.idl
Class RuntimeWiring.Builder
- java.lang.Object
-
- graphql.schema.idl.RuntimeWiring.Builder
-
- Enclosing class:
- RuntimeWiring
@PublicApi public static class RuntimeWiring.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RuntimeWiring
build()
RuntimeWiring.Builder
codeRegistry(GraphQLCodeRegistry codeRegistry)
This allows you to seed in your ownGraphQLCodeRegistry
instanceRuntimeWiring.Builder
codeRegistry(GraphQLCodeRegistry.Builder codeRegistry)
This allows you to seed in your ownGraphQLCodeRegistry
instanceRuntimeWiring.Builder
comparatorRegistry(GraphqlTypeComparatorRegistry comparatorRegistry)
You can specify your own sort order of graphql types viaGraphqlTypeComparatorRegistry
which will tell you what type of objects you are to sort when it asks for a comparator.RuntimeWiring.Builder
directive(java.lang.String directiveName, SchemaDirectiveWiring schemaDirectiveWiring)
This provides the wiring code for a named directive.RuntimeWiring.Builder
directiveWiring(SchemaDirectiveWiring schemaDirectiveWiring)
This adds a directive wiring that will be called for all directives.RuntimeWiring.Builder
fieldVisibility(GraphqlFieldVisibility fieldVisibility)
This allows you to add a field visibility that will be associated with the schemaRuntimeWiring.Builder
scalar(GraphQLScalarType scalarType)
This allows you to add in new custom Scalar implementations beyond the standard set.RuntimeWiring.Builder
transformer(SchemaGeneratorPostProcessing schemaGeneratorPostProcessing)
Deprecated.This mechanism can be achieved in a better way viaSchemaTransformer
after the schema is builtRuntimeWiring.Builder
type(TypeRuntimeWiring typeRuntimeWiring)
This adds a type wiringRuntimeWiring.Builder
type(TypeRuntimeWiring.Builder builder)
This allows you to add a new type wiring via a builderRuntimeWiring.Builder
type(java.lang.String typeName, java.util.function.UnaryOperator<TypeRuntimeWiring.Builder> builderFunction)
This form allows a lambda to be used as the builder of a type wiringRuntimeWiring.Builder
wiringFactory(WiringFactory wiringFactory)
Adds a wiring factory into the runtime wiring
-
-
-
Method Detail
-
wiringFactory
public RuntimeWiring.Builder wiringFactory(WiringFactory wiringFactory)
Adds a wiring factory into the runtime wiring- Parameters:
wiringFactory
- the wiring factory to add- Returns:
- this outer builder
-
codeRegistry
public RuntimeWiring.Builder codeRegistry(GraphQLCodeRegistry codeRegistry)
This allows you to seed in your ownGraphQLCodeRegistry
instance- Parameters:
codeRegistry
- the code registry to use- Returns:
- this outer builder
-
codeRegistry
public RuntimeWiring.Builder codeRegistry(GraphQLCodeRegistry.Builder codeRegistry)
This allows you to seed in your ownGraphQLCodeRegistry
instance- Parameters:
codeRegistry
- the code registry to use- Returns:
- this outer builder
-
scalar
public RuntimeWiring.Builder scalar(GraphQLScalarType scalarType)
This allows you to add in new custom Scalar implementations beyond the standard set.- Parameters:
scalarType
- the new scalar implementation- Returns:
- the runtime wiring builder
-
fieldVisibility
public RuntimeWiring.Builder fieldVisibility(GraphqlFieldVisibility fieldVisibility)
This allows you to add a field visibility that will be associated with the schema- Parameters:
fieldVisibility
- the new field visibility- Returns:
- the runtime wiring builder
-
type
public RuntimeWiring.Builder type(TypeRuntimeWiring.Builder builder)
This allows you to add a new type wiring via a builder- Parameters:
builder
- the type wiring builder to use- Returns:
- this outer builder
-
type
public RuntimeWiring.Builder type(java.lang.String typeName, java.util.function.UnaryOperator<TypeRuntimeWiring.Builder> builderFunction)
This form allows a lambda to be used as the builder of a type wiring- Parameters:
typeName
- the name of the type to wirebuilderFunction
- a function that will be given the builder to use- Returns:
- the runtime wiring builder
-
type
public RuntimeWiring.Builder type(TypeRuntimeWiring typeRuntimeWiring)
This adds a type wiring- Parameters:
typeRuntimeWiring
- the new type wiring- Returns:
- the runtime wiring builder
-
directive
public RuntimeWiring.Builder directive(java.lang.String directiveName, SchemaDirectiveWiring schemaDirectiveWiring)
This provides the wiring code for a named directive.Note: The provided directive wiring will ONLY be called back if an element has a directive with the specified name.
To be called back for every directive the use
directiveWiring(SchemaDirectiveWiring)
or useWiringFactory.providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment)
instead.- Parameters:
directiveName
- the name of the directive to wireschemaDirectiveWiring
- the runtime behaviour of this wiring- Returns:
- the runtime wiring builder
- See Also:
directiveWiring(SchemaDirectiveWiring)
,SchemaDirectiveWiring
,WiringFactory.providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment)
-
directiveWiring
public RuntimeWiring.Builder directiveWiring(SchemaDirectiveWiring schemaDirectiveWiring)
This adds a directive wiring that will be called for all directives.Note : Unlike
directive(String, SchemaDirectiveWiring)
which is only called back if a named directives is present, this directive wiring will be called back for every element in the schema even if it has zero directives.- Parameters:
schemaDirectiveWiring
- the runtime behaviour of this wiring- Returns:
- the runtime wiring builder
- See Also:
directive(String, SchemaDirectiveWiring)
,SchemaDirectiveWiring
,WiringFactory.providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment)
-
comparatorRegistry
public RuntimeWiring.Builder comparatorRegistry(GraphqlTypeComparatorRegistry comparatorRegistry)
You can specify your own sort order of graphql types viaGraphqlTypeComparatorRegistry
which will tell you what type of objects you are to sort when it asks for a comparator.- Parameters:
comparatorRegistry
- your own comparator registry- Returns:
- the runtime wiring builder
-
transformer
@Deprecated public RuntimeWiring.Builder transformer(SchemaGeneratorPostProcessing schemaGeneratorPostProcessing)
Deprecated.This mechanism can be achieved in a better way viaSchemaTransformer
after the schema is builtAdds a schema transformer into the mix- Parameters:
schemaGeneratorPostProcessing
- the non null schema transformer to add- Returns:
- the runtime wiring builder
-
build
public RuntimeWiring build()
- Returns:
- the built runtime wiring
-
-