See individual packages for more details.
- graphql-prefab-exe - a bundled, standalone language-agnostic GraphQL application
- graphql-prefab-server - a standalone, language-agnostic GraphQL Node server
- graphql-prefab-resolvers - a flexible, language agnostic way to reduce resolver boilerplate
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.
- url - required
- method
- responseType
- url
- headers
- data
- params
- timeout
- baseURL
- withCredentials
- proxy
- maxRedirects
- maxContentLength
- xsrfCookieName
- xsrfHeaderName
{
"use": "http",
"options": {
"url": "$env.BACKEND_URL/v1/acceptance_documents/$args.type",
"timeout": 5000
}
}
Perform one of the functions in the
ramda
library.
- fn - required
- args
{
"use": "ramda",
"options": {
"fn": "path",
"args": [
["acceptance_document"]
]
}
}
Query postgres using the
node-postgres
package.
{
"use": "postgres",
"options": {
"query": {
"text": "SELECT * FROM features"
}
}
}