Skip to content

Instantly share code, notes, and snippets.

@brendanmckenzie
Created March 26, 2021 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendanmckenzie/a483b845836b0a8195d0139065985adc to your computer and use it in GitHub Desktop.
Save brendanmckenzie/a483b845836b0a8195d0139065985adc to your computer and use it in GitHub Desktop.
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);
{
"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"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment