chore(postgraphile): initial commit

This commit is contained in:
dancingCycle 2024-03-06 14:29:47 +01:00
parent 35b5c708a9
commit c5d5800a0e
5 changed files with 2076 additions and 0 deletions

1
postgraphile/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env*

28
postgraphile/index.js Normal file
View File

@ -0,0 +1,28 @@
require('dotenv').config();
const express = require("express");
const { postgraphile } = require("postgraphile");
const app = express();
const postgraphileOptions = {
watchPg: true,
dynamicJson: true,
setofFunctionsContainNulls: false,
ignoreRBAC: false,
showErrorStack: "json",
extendedErrors: ["hint", "detail", "errcode"],
exportGqlSchemaPath: "schema.graphql",
graphiql: true,
enhanceGraphiql: true,
allowExplain(_) {
return true;
},
enableQueryBatching: true,
legacyRelations: "omit",
};
console.log('database url: ', process.env.DATABASE_URL);
app.use(postgraphile(process.env.DATABASE_URL, "public", postgraphileOptions));
console.log('port: ', process.env.PORT);
app.listen(process.env.PORT);

2024
postgraphile/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

19
postgraphile/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "postgraphile",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Stefan Begerad",
"license": "GPL-3.0",
"dependencies": {
"dotenv": "16.4.5",
"express": "4.18.3",
"postgraphile": "4.13.0"
},
"devDependencies": {
"nodemon": "3.1.0"
}
}

4
postgraphile/readme.md Normal file
View File

@ -0,0 +1,4 @@
```
npm i
node index.js
```