Class CodeRegistryUtil


  • public class CodeRegistryUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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)
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CodeRegistryUtil

        public CodeRegistryUtil()
    • 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 datafetcher
        environment - the environment object of the Wiring process
        mapFunction - 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 builder
        parentElement - the parent name
        fieldDefinition - the field definition which the data fetcher is linked to
        Returns:
        the data fetcher