Class DataFetcherResultAdapter<T>
- java.lang.Object
-
- io.leangen.graphql.generator.mapping.common.AbstractTypeSubstitutingMapper<T>
-
- io.leangen.graphql.generator.mapping.core.DataFetcherResultAdapter<T>
-
- All Implemented Interfaces:
ResolverInterceptorFactory,DelegatingOutputConverter<graphql.execution.DataFetcherResult<T>,graphql.execution.DataFetcherResult<?>>,OutputConverter<graphql.execution.DataFetcherResult<T>,graphql.execution.DataFetcherResult<?>>,TypeMapper,TypeSubstituter
public class DataFetcherResultAdapter<T> extends AbstractTypeSubstitutingMapper<T> implements DelegatingOutputConverter<graphql.execution.DataFetcherResult<T>,graphql.execution.DataFetcherResult<?>>, ResolverInterceptorFactory
-
-
Field Summary
-
Fields inherited from class io.leangen.graphql.generator.mapping.common.AbstractTypeSubstitutingMapper
substituteType
-
-
Constructor Summary
Constructors Constructor Description DataFetcherResultAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description graphql.execution.DataFetcherResult<?>convertOutput(graphql.execution.DataFetcherResult<T> original, AnnotatedType type, ResolutionEnvironment env)List<AnnotatedType>getDerivedTypes(AnnotatedType type)List<ResolverInterceptor>getInterceptors(ResolverInterceptorFactoryParams params)Produces inner ResolverInterceptors, invoked around the resolver method.List<ResolverInterceptor>getOuterInterceptors(ResolverInterceptorFactoryParams params)Produces outer ResolverInterceptors, invoked around result conversion.AnnotatedTypegetSubstituteType(AnnotatedType original)Returns the type to map instead of the original.booleanisTransparent()ADelegatingOutputConverteris considered transparent if its sole purpose is to delegate to other converters, and contains no other logic of its own.booleansupports(AnnotatedElement element, AnnotatedType type)graphql.schema.GraphQLInputTypetoGraphQLInputType(AnnotatedType javaType, Set<Class<? extends TypeMapper>> mappersToSkip, TypeMappingEnvironment env)-
Methods inherited from class io.leangen.graphql.generator.mapping.common.AbstractTypeSubstitutingMapper
toGraphQLType
-
-
-
-
Method Detail
-
toGraphQLInputType
public graphql.schema.GraphQLInputType toGraphQLInputType(AnnotatedType javaType, Set<Class<? extends TypeMapper>> mappersToSkip, TypeMappingEnvironment env)
- Specified by:
toGraphQLInputTypein interfaceTypeMapper- Overrides:
toGraphQLInputTypein classAbstractTypeSubstitutingMapper<T>
-
getSubstituteType
public AnnotatedType getSubstituteType(AnnotatedType original)
Description copied from class:AbstractTypeSubstitutingMapperReturns the type to map instead of the original. This implementation always returns the type of the generic type parameterS.- Specified by:
getSubstituteTypein interfaceTypeSubstituter- Overrides:
getSubstituteTypein classAbstractTypeSubstitutingMapper<T>- Parameters:
original- The type to be replaced- Returns:
- The substitute type to use for mapping
-
convertOutput
public graphql.execution.DataFetcherResult<?> convertOutput(graphql.execution.DataFetcherResult<T> original, AnnotatedType type, ResolutionEnvironment env)
- Specified by:
convertOutputin interfaceOutputConverter<graphql.execution.DataFetcherResult<T>,graphql.execution.DataFetcherResult<?>>
-
supports
public boolean supports(AnnotatedElement element, AnnotatedType type)
- Specified by:
supportsin interfaceOutputConverter<graphql.execution.DataFetcherResult<T>,graphql.execution.DataFetcherResult<?>>- Specified by:
supportsin interfaceTypeMapper
-
getDerivedTypes
public List<AnnotatedType> getDerivedTypes(AnnotatedType type)
- Specified by:
getDerivedTypesin interfaceDelegatingOutputConverter<graphql.execution.DataFetcherResult<T>,graphql.execution.DataFetcherResult<?>>
-
isTransparent
public boolean isTransparent()
Description copied from interface:DelegatingOutputConverterADelegatingOutputConverteris considered transparent if its sole purpose is to delegate to other converters, and contains no other logic of its own. In other words, if there is no reason to invoke it without other applicable converters present. This flag is purely a performance optimization hint, and is always safe to leave onfalse.- Specified by:
isTransparentin interfaceDelegatingOutputConverter<graphql.execution.DataFetcherResult<T>,graphql.execution.DataFetcherResult<?>>- Returns:
- A boolean signifying whether the converter is transparent.
-
getInterceptors
public List<ResolverInterceptor> getInterceptors(ResolverInterceptorFactoryParams params)
Description copied from interface:ResolverInterceptorFactoryProduces inner ResolverInterceptors, invoked around the resolver method.Calling
ResolverInterceptor.Continuation.proceed(InvocationContext)produces the raw (unconverted) result.- Specified by:
getInterceptorsin interfaceResolverInterceptorFactory- Parameters:
params- Factory parameters- Returns:
- a list of outer interceptors
-
getOuterInterceptors
public List<ResolverInterceptor> getOuterInterceptors(ResolverInterceptorFactoryParams params)
Description copied from interface:ResolverInterceptorFactoryProduces outer ResolverInterceptors, invoked around result conversion.Calling
ResolverInterceptor.Continuation.proceed(InvocationContext)produces the converted result.- Specified by:
getOuterInterceptorsin interfaceResolverInterceptorFactory- Parameters:
params- Factory parameters- Returns:
- a list of outer interceptors
-
-