sails-hook-mlprciographql

1.0.1 • Public • Published

Stories in Ready Build Status

sails-hook-mlprciographql

About

A sails hook aimed at simplifying GraphQL integration.

Installation

npm install --save sails-hook-mlprciographql

Usage

After installing, (and configuring the database to your liking) you can summon ´sails.graphql´ to receive a Promise like so:

//For the default controller
index(req, res) {
    sails.graphql(req)
    .then((result) => {
      //Very important statements
      return res.json(result.data);
    })
    .catch((err)=>{
      //Oops.
      res.send(500, err);
    });
  }

Package Sidebar

Install

npm i sails-hook-mlprciographql

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • malpercio
  • sanjorgek