Class DefaultOperationBuilder
- java.lang.Object
-
- io.leangen.graphql.metadata.strategy.query.DefaultOperationBuilder
-
- All Implemented Interfaces:
OperationBuilder
public class DefaultOperationBuilder extends Object implements OperationBuilder
- Author:
- Bojan Tomic (kaqqao)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultOperationBuilder.TypeInferenceNONE- No type inference.
-
Constructor Summary
Constructors Constructor Description DefaultOperationBuilder(DefaultOperationBuilder.TypeInference typeInference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OperationbuildMutation(Type context, List<Resolver> resolvers, GlobalEnvironment environment)OperationbuildQuery(Type contextType, List<Resolver> resolvers, GlobalEnvironment environment)OperationbuildSubscription(Type context, List<Resolver> resolvers, GlobalEnvironment environment)protected List<OperationArgument>collectArguments(String operationName, List<Resolver> resolvers)protected booleanisAsync(List<Resolver> resolvers)protected booleanisBatched(List<Resolver> resolvers)protected AnnotatedTyperesolveJavaType(String operationName, List<Resolver> resolvers, MessageBundle messageBundle)protected StringresolveName(List<Resolver> resolvers)protected AnnotatedTypeunionize(AnnotatedType[] types, MessageBundle messageBundle)
-
-
-
Constructor Detail
-
DefaultOperationBuilder
public DefaultOperationBuilder(DefaultOperationBuilder.TypeInference typeInference)
- Parameters:
typeInference- Controls automatic type inference if multiple resolver methods for the same operation return different types, or if different resolver methods specify arguments of the same name but of different types.The inference process selects the most specific common super type of all the detected types.
This feature is off by default as it can lead to surprising results when used unconsciously.
Example:
{@code
-
-
Method Detail
-
buildQuery
public Operation buildQuery(Type contextType, List<Resolver> resolvers, GlobalEnvironment environment)
- Specified by:
buildQueryin interfaceOperationBuilder
-
buildMutation
public Operation buildMutation(Type context, List<Resolver> resolvers, GlobalEnvironment environment)
- Specified by:
buildMutationin interfaceOperationBuilder
-
buildSubscription
public Operation buildSubscription(Type context, List<Resolver> resolvers, GlobalEnvironment environment)
- Specified by:
buildSubscriptionin interfaceOperationBuilder
-
resolveJavaType
protected AnnotatedType resolveJavaType(String operationName, List<Resolver> resolvers, MessageBundle messageBundle)
-
collectArguments
protected List<OperationArgument> collectArguments(String operationName, List<Resolver> resolvers)
-
unionize
protected AnnotatedType unionize(AnnotatedType[] types, MessageBundle messageBundle)
-
-