Package graphql.schema.idl
Class TypeRuntimeWiring.Builder
java.lang.Object
graphql.schema.idl.TypeRuntimeWiring.Builder
- Enclosing class:
TypeRuntimeWiring
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DataFetcher
private EnumValuesProvider
private final Map
<String, DataFetcher> private String
private TypeResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
dataFetcher
(String fieldName, DataFetcher dataFetcher) Adds a data fetcher for the current type to the specified fielddataFetchers
(Map<String, DataFetcher> dataFetchersMap) Adds data fetchers for the current type to the specified fielddefaultDataFetcher
(DataFetcher dataFetcher) All fields in a type need a data fetcher of some sort and this method is called to provide the default data fetcher that will be used for this type if no specific one has been provided per field.enumValues
(EnumValuesProvider enumValuesProvider) Sets the type name for this type wiring.typeResolver
(TypeResolver typeResolver) Adds aTypeResolver
to the current type.
-
Field Details
-
fieldDataFetchers
-
typeName
-
defaultDataFetcher
-
typeResolver
-
enumValuesProvider
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
typeName
Sets the type name for this type wiring. You MUST set this.- Parameters:
typeName
- the name of the type- Returns:
- the current type wiring
-
dataFetcher
Adds a data fetcher for the current type to the specified field- Parameters:
fieldName
- the field that data fetcher should apply todataFetcher
- the new data Fetcher- Returns:
- the current type wiring
-
dataFetchers
Adds data fetchers for the current type to the specified field- Parameters:
dataFetchersMap
- a map of fields to data fetchers- Returns:
- the current type wiring
-
defaultDataFetcher
All fields in a type need a data fetcher of some sort and this method is called to provide the default data fetcher that will be used for this type if no specific one has been provided per field.- Parameters:
dataFetcher
- the default data fetcher to use for this type- Returns:
- the current type wiring
-
typeResolver
Adds aTypeResolver
to the current type. This MUST be specified for Interface and Union types.- Parameters:
typeResolver
- the type resolver in play- Returns:
- the current type wiring
-
enumValues
-
build
- Returns:
- the built type wiring
-