forked from benjie/ouch-my-finger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphile.config.mjs
52 lines (49 loc) · 1.59 KB
/
graphile.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// @ts-check
import { makePgService } from "@dataplan/pg/adaptors/pg";
import { PostGraphileAmberPreset } from "postgraphile/presets/amber";
import { makeV4Preset } from "postgraphile/presets/v4";
import { PostGraphileConnectionFilterPreset } from "postgraphile-plugin-connection-filter";
import { PgAggregatesPreset } from "@graphile/pg-aggregates";
import { PgManyToManyPreset } from "@graphile-contrib/pg-many-to-many";
// import { PgSimplifyInflectionPreset } from "@graphile/simplify-inflection";
import { PgOmitArchivedPlugin } from "@graphile-contrib/pg-omit-archived";
import ListPlugin from "./modules/list/list-plugin.mjs";
// For configuration file details, see: https://postgraphile.org/postgraphile/next/config
/** @satisfies {GraphileConfig.Preset} */
const preset = {
extends: [
// PostGraphileAmberPreset,
makeV4Preset({
/* Enter your V4 options here */
// graphiql: true,
// graphiqlRoute: "/",
appendPlugins: [
ListPlugin,
]
}),
// PostGraphileConnectionFilterPreset,
// PgManyToManyPreset,
// PgAggregatesPreset,
// PgSimplifyInflectionPreset
],
// plugins: [PgOmitArchivedPlugin],
pgServices: [
makePgService({
// Database connection string:
connectionString: process.env.DATABASE_URL,
// List of schemas to expose:
schemas: process.env.DATABASE_SCHEMAS?.split(",") ?? ["public"],
// Enable LISTEN/NOTIFY:
pubsub: true,
}),
],
grafserv: {
port: 5678,
websockets: true,
// allowUnpersistedOperation: true,
},
grafast: {
explain: true,
},
};
export default preset;