1.0.4 • Published 2 years ago

@graphile/pro v1.0.4

Weekly downloads
4,068
License
SEE LICENSE IN LI...
Repository
-
Last release
2 years ago

@graphile/pro

This is a PostGraphile plugin that includes a number of optional protections for your production server. Unlike PostGraphile, this plugin is NOT open source software - see "License key" lower down.

Current protections:

  • Force pagination caps (require user to supply a 'first' or 'last' argument to collections, customise or disable per table via @paginationCap smart comment)
  • Scale by sending queries to read replicas
  • Limiting GraphQL query depth
  • GraphQL cost limit (experimental! Estimates the cost of a GraphQL query before sending it to the database, aborts if it looks too expensive. Good production protection, but also great during development to ensure you've thought carefully about the queries you're building, helping you make faster applications.)

To read about these protections, see:

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

Usage

CLI:

yarn add postgraphile @graphile/pro
export GRAPHILE_LICENSE="MY_LICENSE_KEY_HERE"
yarn postgraphile --plugins @graphile/pro

Library:

Assuming you have server.js something like:

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

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

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

Install and run:

yarn add postgraphile @graphile/pro
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/

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.11.0

3 years ago

0.10.0

4 years ago

0.9.1

4 years ago

0.9.0

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago