-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphile.config.mjs
45 lines (42 loc) · 1.31 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
// @ts-check
import { makePgService } from "@dataplan/pg/adaptors/pg";
import AmberPreset 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";
// For configuration file details, see: https://postgraphile.org/postgraphile/next/config
/** @satisfies {GraphileConfig.Preset} */
const preset = {
extends: [
AmberPreset.default ?? AmberPreset,
makeV4Preset({
/* Enter your V4 options here */
graphiql: true,
graphiqlRoute: "/",
}),
PostGraphileConnectionFilterPreset,
PgManyToManyPreset,
PgAggregatesPreset,
// PgSimplifyInflectionPreset
],
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,
},
grafast: {
explain: true,
},
};
export default preset;