ExecutionContext

A context of GraphQL operation execution, represented as a set of Key keys and corresponding Element values.

It is inspired by the coroutines Context and allows to pass arbitrary data to interceptors.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard

An element of the ExecutionContext. An element of the execution context is a singleton context by itself.

Link copied to clipboard

Key for the elements of ExecutionContext. E is a type of element with this key.

Functions

Link copied to clipboard
abstract fun <R> fold(initial: R, operation: (R, ExecutionContext.Element) -> R): R

Accumulates entries of this context starting with initial value and applying operation from left to right to current accumulator value and each element of this context.

Link copied to clipboard
abstract operator fun <E : ExecutionContext.Element> get(key: ExecutionContext.Key<E>): E?

Returns the element with the given key from this context or null.

Link copied to clipboard

Returns a context containing elements from this context, but without an element with the specified key.

Link copied to clipboard
open operator fun plus(context: ExecutionContext): ExecutionContext

Returns a context containing elements from this context and elements from other context. The elements from this context with the same key as in the other one are dropped.