Package graphql.schema.idl
Class RuntimeWiring.Builder
java.lang.Object
graphql.schema.idl.RuntimeWiring.Builder
- Enclosing class:
RuntimeWiring
-
Method Summary
Modifier and TypeMethodDescriptionbuild()codeRegistry(GraphQLCodeRegistry codeRegistry) This allows you to seed in your ownGraphQLCodeRegistryinstancecodeRegistry(GraphQLCodeRegistry.Builder codeRegistry) This allows you to seed in your ownGraphQLCodeRegistryinstancecomparatorRegistry(GraphqlTypeComparatorRegistry comparatorRegistry) You can specify your own sort order of graphql types viaGraphqlTypeComparatorRegistrywhich will tell you what type of objects you are to sort when it asks for a comparator.directive(String directiveName, SchemaDirectiveWiring schemaDirectiveWiring) This provides the wiring code for a named directive.directiveWiring(SchemaDirectiveWiring schemaDirectiveWiring) This adds a directive wiring that will be called for all directives.fieldVisibility(GraphqlFieldVisibility fieldVisibility) This allows you to add a field visibility that will be associated with the schemascalar(GraphQLScalarType scalarType) This allows you to add in new custom Scalar implementations beyond the standard set.Deprecated, for removal: This API element is subject to removal in a future version.strictMode(boolean strictMode) This sets strict mode as true or false.type(TypeRuntimeWiring typeRuntimeWiring) This adds a type wiringtype(TypeRuntimeWiring.Builder builder) This allows you to add a new type wiring via a buildertype(String typeName, UnaryOperator<TypeRuntimeWiring.Builder> builderFunction) This form allows a lambda to be used as the builder of a type wiringwiringFactory(WiringFactory wiringFactory) Adds a wiring factory into the runtime wiring
-
Method Details
-
strictMode
This sets strict mode as true or false. If strictMode is true, if things get defined twice, for example, it will throw aStrictModeWiringException.- Returns:
- this builder
-
strictMode
Deprecated, for removal: This API element is subject to removal in a future version.strictMode default value changed to true, usestrictMode(boolean)insteadThis puts the builder into strict mode, so if things get defined twice, for example, it will throw aStrictModeWiringException.- Returns:
- this builder
-
wiringFactory
Adds a wiring factory into the runtime wiring- Parameters:
wiringFactory- the wiring factory to add- Returns:
- this outer builder
-
codeRegistry
This allows you to seed in your ownGraphQLCodeRegistryinstance- Parameters:
codeRegistry- the code registry to use- Returns:
- this outer builder
-
codeRegistry
This allows you to seed in your ownGraphQLCodeRegistryinstance- Parameters:
codeRegistry- the code registry to use- Returns:
- this outer builder
-
scalar
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
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
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(String typeName, 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
This adds a type wiring- Parameters:
typeRuntimeWiring- the new type wiring- Returns:
- the runtime wiring builder
-
directive
public RuntimeWiring.Builder directive(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
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:
-
comparatorRegistry
You can specify your own sort order of graphql types viaGraphqlTypeComparatorRegistrywhich 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
-
build
- Returns:
- the built runtime wiring
-
strictMode(boolean)instead