@graphile/supporter
Version:
PostGraphile enhancements for development sponsors
59 lines (41 loc) • 1.4 kB
Markdown
# /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 /supporter
export GRAPHILE_LICENSE="MY_LICENSE_KEY_HERE"
yarn postgraphile --plugins /supporter --simple-subscriptions
```
### Library:
Assuming you have `server.js` something like:
```js
// 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 /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/