0.8.4 • Published 5 years ago

@graphile/supporter v0.8.4

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
5 years ago

@graphile/supporter

This is a PostGraphile plugin with enhancements for people who financially support PostGraphile's development. Unlike PostGraphile, this plugin is NOT open source software - see "License key" lower down.

Currently it introduces a simple subscriptions feature; for documentation see:

https://www.graphile.org/postgraphile/subscriptions/

Usage

CLI:

yarn add postgraphile @graphile/supporter
export GRAPHILE_LICENSE="MY_LICENSE_KEY_HERE"
yarn postgraphile --plugins @graphile/supporter --simple-subscriptions

Library:

Assuming you have server.js something like:

// server.js
const http = require("http");
const { postgraphile, makePluginHook } = require("postgraphile");

const pluginHook = makePluginHook([require("@graphile/supporter").default]);

http
  .createServer(
    postgraphile(process.env.DATABASE_URL, "public", {
      pluginHook,
      simpleSubscriptions: true,
    })
  )
  .listen(5000);

Install and run:

yarn add postgraphile @graphile/supporter
export GRAPHILE_LICENSE="MY_LICENSE_KEY_HERE"
node server.js

License key

You must specify the license key in an environmental variable GRAPHILE_LICENSE. You can acquire the license key from https://store.graphile.com

If you fail to provide the license key, then the module will throw an error.

Read more: https://www.graphile.org/postgraphile/plugins/