JSPM

hasura-actions

0.0.0-1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q21123F
  • License ISC

Hasura actions simplified

Package Exports

  • hasura-actions

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hasura-actions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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}`
        }
    }
}