Classes
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.
Type:
-
Object
Methods
(inner) ⌾⠀getLatticePrefs() → {Object}
It may be necessary to read GraphQL Lattice preferences from the nearestpackage.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.
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.
Parameters:
Name | Type | Description |
---|---|---|
method |
function
|
a function to wrap in an asynchronous function |
context |
mixed
|
an optional |
Returns:
- Type:
-
function
an asynchronous function, i.e. one that returns a promise
containing the contents the callback results, that wraps the supplied
function.