Class: Context

Isolated

The GraphQL context object used to pass the meta information between resolvers.

Methods

set

Sets a given value for a given key in the GraphQL context.

add
D

Adds a value to the GraphQL context.

get

Retrieves a value using the given key from the GraphQL context.

remove

Removes a value using the given key from the GraphQL context.

set

function set(string 'key, Cloneable | isolated object {}  value)
Isolated Function

Sets a given value for a given key in the GraphQL context.

Parameters

  • value Cloneable | isolated object {}
  • Value to be set

add

function add(string 'key, Cloneable | isolated object {}  value) returns Error?
Deprecated
Isolated Function

Adds a value to the GraphQL context.

Parameters

  • value Cloneable | isolated object {}
  • The value to be set

Return Type

(Error?)

A graphql:Error if the key already exists in the context, nil otherwise

Deprecated

This function is deprecated and will be removed in a future release. Please use set method instead.

get

function get(string 'key) returns Cloneable | isolated object {} | Error
Isolated Function

Retrieves a value using the given key from the GraphQL context.

Parameters

Return Type

(Cloneable | isolated object {} | Error)

The value if the key is present in the context, a graphql:Error otherwise

remove

function remove(string 'key) returns Cloneable | isolated object {} | Error
Isolated Function

Removes a value using the given key from the GraphQL context.

Parameters

Return Type

(Cloneable | isolated object {} | Error)

The value if the key is present in the context, a graphql:Error otherwise