How to use the postgraphile.makePluginHook function in postgraphile

To help you get started, we’ve selected a few postgraphile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphile / bootstrap-react-apollo / server / middleware / installPostGraphile.js View on Github external
} else {
  console.log();
  console.log(
    `Please support PostGraphile development:\n\n  ${chalk.blue.bold.underline(
      "https://graphile.org/donate"
    )} 🙏`
  );
  console.log();
}
/* eslint-enable */

const isDev = process.env.NODE_ENV === "development";
const isTest = process.env.NODE_ENV === "test";

/* Load any PostGraphile server plugins (different from Graphile Engine schema plugins) */
const pluginHook = makePluginHook([PgPubsub, PostGraphilePro].filter(_ => _));

/*
 * This function generates the options for a PostGraphile instance to use. We
 * make it a separate function call so that we may call it from other places
 * (such as tests) and even parameterise it if we want.
 */
function postgraphileOptions(overrides) {
  return {
    // This is for PostGraphile server plugins: https://www.graphile.org/postgraphile/plugins/
    pluginHook,

    // This is so that PostGraphile installs the watch fixtures, it's also needed to enable live queries
    ownerConnectionString: process.env.DATABASE_URL,

    // Add websocket support to the PostGraphile server; you still need to use a subscriptions plugin such as
    // @graphile/pg-pubsub

postgraphile

A GraphQL schema created by reflection over a PostgreSQL schema 🐘 (previously known as PostGraphQL)

MIT
Latest version published 1 year ago

Package Health Score

78 / 100
Full package analysis