Class CodeRegistryUtil
- java.lang.Object
-
- graphql.annotations.processor.util.CodeRegistryUtil
-
public class CodeRegistryUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CodeRegistryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static graphql.schema.DataFetchergetDataFetcher(graphql.schema.GraphQLCodeRegistry.Builder codeRegistryBuilder, graphql.schema.GraphQLSchemaElement parentElement, graphql.schema.GraphQLFieldDefinition fieldDefinition)this util method helps you retrieve the data fetcher from the code registry if you do not have the whole parent object (only parent name)static voidwrapDataFetcher(graphql.schema.GraphQLFieldDefinition fieldDefinition, AnnotationsWiringEnvironment environment, java.util.function.BiFunction<graphql.schema.DataFetchingEnvironment,java.lang.Object,java.lang.Object> mapFunction)This util method helps you wrap your datafetcher with some lambda code
-
-
-
Method Detail
-
wrapDataFetcher
public static void wrapDataFetcher(graphql.schema.GraphQLFieldDefinition fieldDefinition, AnnotationsWiringEnvironment environment, java.util.function.BiFunction<graphql.schema.DataFetchingEnvironment,java.lang.Object,java.lang.Object> mapFunction)This util method helps you wrap your datafetcher with some lambda code- Parameters:
fieldDefinition- The field you want to wrap its datafetcherenvironment- the environment object of the Wiring processmapFunction- the lambda expression to wrap with
-
getDataFetcher
public static graphql.schema.DataFetcher getDataFetcher(graphql.schema.GraphQLCodeRegistry.Builder codeRegistryBuilder, graphql.schema.GraphQLSchemaElement parentElement, graphql.schema.GraphQLFieldDefinition fieldDefinition)this util method helps you retrieve the data fetcher from the code registry if you do not have the whole parent object (only parent name)- Parameters:
codeRegistryBuilder- the code registry builderparentElement- the parent namefieldDefinition- the field definition which the data fetcher is linked to- Returns:
- the data fetcher
-
-