utils

utils

Source:

Classes

Deferred

Members

(static, constant) LatticeLogs :Object

A small near pass-thru facility for logging within Lattice such that error
objects supplied get mapped to their message unless LATTICE_ERRORS=STACK
is set in process.env.

Note the order of log levels for Lattice may be somewhat non-standard. Info
has been taken out of flow and placed above error to solve issues with jest
logging.

Source:
Type:
  • Object

Methods

(inner) ⌾⠀getLatticePrefs() → {Object}

It may be necessary to read GraphQL Lattice preferences from the nearest
package.json object to the excuting code. getLatticePrefs() does this
and merges any subsequently found options in said file on top of the
default values specified here in this file.

Since:
  • 2.13.0
Source:
Returns:
Type:
Object

an object containing at least the defaults plus any other
values specified in package.json

(inner) ⌾⠀promisify(method, context) → {function}

A simply promisify style function that returns an async function wrapped
around a supplied function designed for the standard callback methodology.
If the callback is the last parameter, and that callback is in the form of
(error, ...results) then this wrapper will do the trick for you.

Since:
  • 2.7.0
Source:
Parameters:
Name Type Description
method function

a function to wrap in an asynchronous function

context mixed

an optional this object for use with the supplied
function.

Returns:
Type:
function

an asynchronous function, i.e. one that returns a promise
containing the contents the callback results, that wraps the supplied
function.