Package graphql

Class ExecutionInput.Builder

  • Enclosing class:
    ExecutionInput

    public static class ExecutionInput.Builder
    extends java.lang.Object
    • Field Detail

      • extensions

        public java.util.Map<java.lang.String,​java.lang.Object> extensions
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • executionId

        public ExecutionInput.Builder executionId​(ExecutionId executionId)
        A default one will be assigned, but you can set your own.
        Parameters:
        executionId - an execution id object
        Returns:
        this builder
      • locale

        public ExecutionInput.Builder locale​(java.util.Locale locale)
        Sets the locale to use for this operation
        Parameters:
        locale - the locale to use
        Returns:
        this builder
      • localContext

        public ExecutionInput.Builder localContext​(java.lang.Object localContext)
        Sets initial localContext in root data fetchers
        Parameters:
        localContext - the local context to use
        Returns:
        this builder
      • context

        @Deprecated(since="2021-07-05")
        public ExecutionInput.Builder context​(java.lang.Object context)
        Deprecated.
        - the ExecutionInput.getGraphQLContext() is a fixed mutable instance now
        The legacy context object
        Parameters:
        context - the context object to use
        Returns:
        this builder
      • graphQLContext

        public ExecutionInput.Builder graphQLContext​(java.util.function.Consumer<GraphQLContext.Builder> builderFunction)
        This will give you a builder of GraphQLContext and any values you set will be copied into the underlying GraphQLContext of this execution input
        Parameters:
        builderFunction - a builder function you can use to put values into the context
        Returns:
        this builder
      • graphQLContext

        public ExecutionInput.Builder graphQLContext​(java.util.Map<?,​java.lang.Object> mapOfContext)
        This will put all the values from the map into the underlying GraphQLContext of this execution input
        Parameters:
        mapOfContext - a map of values to put in the context
        Returns:
        this builder
      • variables

        public ExecutionInput.Builder variables​(java.util.Map<java.lang.String,​java.lang.Object> rawVariables)
        Adds raw (not coerced) variables
        Parameters:
        rawVariables - the map of raw variables
        Returns:
        this builder
      • extensions

        public ExecutionInput.Builder extensions​(java.util.Map<java.lang.String,​java.lang.Object> extensions)
      • dataLoaderRegistry

        public ExecutionInput.Builder dataLoaderRegistry​(org.dataloader.DataLoaderRegistry dataLoaderRegistry)
        You should create new DataLoaderRegistrys and new DataLoaders for each execution. Do not re-use instances as this will create unexpected results.
        Parameters:
        dataLoaderRegistry - a registry of DataLoaders
        Returns:
        this builder