Skip to content

Instantly share code, notes, and snippets.

@brendanmckenzie
Created March 26, 2021 22:30
Show Gist options
  • Select an option

  • Save brendanmckenzie/a483b845836b0a8195d0139065985adc to your computer and use it in GitHub Desktop.

Select an option

Save brendanmckenzie/a483b845836b0a8195d0139065985adc to your computer and use it in GitHub Desktop.

Revisions

  1. brendanmckenzie created this gist Mar 26, 2021.
    17 changes: 17 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    const express = require("express");
    const { postgraphile } = require("postgraphile");
    const PostGraphileNestedMutations = require("postgraphile-plugin-nested-mutations");
    const SimplifyInflectorPlugin = require("@graphile-contrib/pg-simplify-inflector");

    const app = express();

    app.use(
    postgraphile(process.env.DATABASE_URL, "public", {
    watchPg: true,
    graphiql: true,
    enhanceGraphiql: true,
    appendPlugins: [PostGraphileNestedMutations, SimplifyInflectorPlugin],
    })
    );

    app.listen(3000);
    15 changes: 15 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    {
    "name": "pgpnm_29",
    "version": "1.0.0",
    "main": "index.js",
    "license": "MIT",
    "dependencies": {
    "@graphile-contrib/pg-simplify-inflector": "^6.1.0",
    "express": "^4.17.1",
    "postgraphile": "^4.11.0",
    "postgraphile-plugin-nested-mutations": "^1.1.0"
    },
    "scripts": {
    "start": "node index.js"
    }
    }