ResolverExecutionContext

A generic context for resolving fields or types

Inheritors

Functions

Link copied to clipboard
abstract fun <T : NodeObject> globalIDStringFor(type: Type<T>, internalID: String): String

Creates a GlobalID and returns it as a String. Example usage: globalIDStringFor(User.Reflection, "123")

Link copied to clipboard
abstract fun <T : NodeObject> nodeRef(id: GlobalID<T>): T

Creates a Node object reference given an ID. Only the ID field is accessible from the created reference. Attempting to access other fields will result in an exception. This can be used to construct resolver responses for fields with Node types.

Link copied to clipboard
inline fun <T : NodeObject> ResolverExecutionContext<*>.nodeRef(localId: String): T

Creates a Node object reference given a Local ID String representation.

Link copied to clipboard
abstract suspend fun query(selections: String, variables: Map<String, Any?> = emptyMap()): Q

Loads the provided selections on the root Query type, and returns the response typed as Q. This is a convenience method that combines selectionsFor and query.

Link copied to clipboard
abstract fun <A : Arguments, BR : Object> rootFieldRef(field: RootObjectField<*, BR, A>, arguments: A): BR

Creates a lazy reference to a root field that will be later resolved by the engine. field must be either a field on the root query type, or a field reachable from the root query type through @namespaceType-typed fields. It must also have an object type.

Link copied to clipboard
abstract fun <T : CompositeOutput> selectionsFor(type: Type<T>, selections: String, variables: Map<String, Any?> = emptyMap()): SelectionSet<T>

Creates a SelectionSet on a provided type from the provided Selections String