See individual packages for more details.
Resolver options
are written in Velocity (via the velocityjs package). Resolver arguments and the process.env
object are available as variables in the options
.
$obj
$args
$ctx
$info
$env = process.env
See examples for usage examples.
Out of the box, graphql-prefab
includes several useful resolvers.
Convert the previously returned object to camelcase keys using the
humps
package.
{ "use": "camelizeKeys" }
Perform an http request using the
axios
package.
{
"use": "http",
"options": {
"url": "$env.BACKEND_URL/v1/acceptance_documents/$args.type",
"timeout": 5000
}
}
Perform one of the functions in the
ramda
library.
{
"use": "ramda",
"options": {
"fn": "path",
"args": [
["acceptance_document"]
]
}
}
Query postgres using the
node-postgres
package.
{
"use": "postgres",
"options": {
"query": {
"text": "SELECT * FROM features"
}
}
}