Class GraphQlContextAccessor

java.lang.Object
org.springframework.graphql.execution.GraphQlContextAccessor
All Implemented Interfaces:
io.micrometer.context.ContextAccessor<graphql.GraphQLContext, graphql.GraphQLContext>

public class GraphQlContextAccessor extends Object implements io.micrometer.context.ContextAccessor<graphql.GraphQLContext, graphql.GraphQLContext>
ContextAccessor that enables support for reading and writing values to and from a GraphQLContext. This accessor is automatically registered via ServiceLoader.
Since:
1.1.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • GraphQlContextAccessor

      public GraphQlContextAccessor()
  • Method Details

    • readableType

      public Class<? extends graphql.GraphQLContext> readableType()
      Specified by:
      readableType in interface io.micrometer.context.ContextAccessor<graphql.GraphQLContext, graphql.GraphQLContext>
    • readValues

      public void readValues(graphql.GraphQLContext context, Predicate<Object> keyPredicate, Map<Object,Object> readValues)
      Specified by:
      readValues in interface io.micrometer.context.ContextAccessor<graphql.GraphQLContext, graphql.GraphQLContext>
    • readValue

      public <T> T readValue(graphql.GraphQLContext context, Object key)
      Specified by:
      readValue in interface io.micrometer.context.ContextAccessor<graphql.GraphQLContext, graphql.GraphQLContext>
    • writeableType

      public Class<? extends graphql.GraphQLContext> writeableType()
      Specified by:
      writeableType in interface io.micrometer.context.ContextAccessor<graphql.GraphQLContext, graphql.GraphQLContext>
    • writeValues

      public graphql.GraphQLContext writeValues(Map<Object,Object> valuesToWrite, graphql.GraphQLContext targetContext)
      Specified by:
      writeValues in interface io.micrometer.context.ContextAccessor<graphql.GraphQLContext, graphql.GraphQLContext>