0.0.0-1 • Published 4 years ago

hasura-actions v0.0.0-1

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Hasura Actions

hasura actions for simplified (single endpoint)

Installation

npm i --save hasura-actions

Usage

const express = require("express");
const hasuraActions = require("hasura-actions");
const config = require("./config");

const app = express();

app.use("/hasura/actions", hasuraActions(config));

app.listen(3000, function(err){
    if(err) console.log(err.message);
    else console.log("Listening on localhost:3000");
});

config.js

module.exports = {
    "action_name": async function(body, headers){
        // Custom Buisness Logic
        return {
            fullname: `${body.input.fname} ${body.input.lname}`
        }
    }
}