@PublicApi public class GraphQLCodeRegistry extends java.lang.Object
GraphQLCodeRegistry
holds that execution code that is associated with graphql types, namely
the DataFetcher
s associated with fields, the TypeResolver
s associated with
abstract types and the GraphqlFieldVisibility
For legacy reasons these code functions can still exist on the original type objects but this will be removed in a future version. Once removed the type system objects will be able have proper hashCode/equals methods and be checked for proper equality.
Modifier and Type | Class and Description |
---|---|
static class |
GraphQLCodeRegistry.Builder |
Modifier and Type | Method and Description |
---|---|
DataFetcher<?> |
getDataFetcher(FieldCoordinates coordinates,
GraphQLFieldDefinition fieldDefinition)
Returns a data fetcher associated with a field located at specified coordinates.
|
DataFetcher<?> |
getDataFetcher(GraphQLFieldsContainer parentType,
GraphQLFieldDefinition fieldDefinition)
Returns a data fetcher associated with a field within a container type
|
GraphqlFieldVisibility |
getFieldVisibility() |
TypeResolver |
getTypeResolver(GraphQLInterfaceType interfaceType)
Returns the type resolver associated with this interface type
|
TypeResolver |
getTypeResolver(GraphQLUnionType unionType)
Returns the type resolver associated with this union type
|
static GraphQLCodeRegistry.Builder |
newCodeRegistry() |
static GraphQLCodeRegistry.Builder |
newCodeRegistry(GraphQLCodeRegistry existingCodeRegistry)
Returns a new builder of
GraphQLCodeRegistry objects based on the existing one |
GraphQLCodeRegistry |
transform(java.util.function.Consumer<GraphQLCodeRegistry.Builder> builderConsumer)
This helps you transform the current
GraphQLCodeRegistry object into another one by starting a builder with all
the current values and allows you to transform it how you want. |
public GraphqlFieldVisibility getFieldVisibility()
GraphqlFieldVisibility
public DataFetcher<?> getDataFetcher(GraphQLFieldsContainer parentType, GraphQLFieldDefinition fieldDefinition)
parentType
- the container typefieldDefinition
- the field definitionpublic DataFetcher<?> getDataFetcher(FieldCoordinates coordinates, GraphQLFieldDefinition fieldDefinition)
coordinates
- the field coordinatesfieldDefinition
- the field definitionpublic TypeResolver getTypeResolver(GraphQLInterfaceType interfaceType)
interfaceType
- the interface typeTypeResolver
public TypeResolver getTypeResolver(GraphQLUnionType unionType)
unionType
- the union typeTypeResolver
public GraphQLCodeRegistry transform(java.util.function.Consumer<GraphQLCodeRegistry.Builder> builderConsumer)
GraphQLCodeRegistry
object into another one by starting a builder with all
the current values and allows you to transform it how you want.builderConsumer
- the consumer code that will be given a builder to transformpublic static GraphQLCodeRegistry.Builder newCodeRegistry()
GraphQLCodeRegistry
objectspublic static GraphQLCodeRegistry.Builder newCodeRegistry(GraphQLCodeRegistry existingCodeRegistry)
GraphQLCodeRegistry
objects based on the existing oneexistingCodeRegistry
- the existing code registry to useGraphQLCodeRegistry
objects