graphile-settings 2.1.7 โ 2.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -0
- package/package.json +12 -5
package/README.md
CHANGED
|
@@ -12,6 +12,120 @@
|
|
|
12
12
|
<a href="https://www.npmjs.com/package/graphile-settings"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql?filename=packages%2Fgraphile-settings%2Fpackage.json"/></a>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
|
+
**`graphile-settings`** is a batteries-included configuration builder for [PostGraphile](https://www.graphile.org/postgraphile/), purpose-built for the [LaunchQL](https://github.com/launchql/launchql) ecosystem. It centralizes plugin setup, schema wiring, and feature flags into a single, composable interface โ enabling consistent, high-performance GraphQL APIs across projects.
|
|
16
|
+
|
|
17
|
+
## ๐ Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install graphile-settings
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## โจ Features
|
|
24
|
+
|
|
25
|
+
* Built-in support for:
|
|
26
|
+
|
|
27
|
+
* โ
Connection filters
|
|
28
|
+
* ๐ Full-text search
|
|
29
|
+
* ๐ PostGIS support (with filters)
|
|
30
|
+
* ๐งฉ Many-to-many helpers
|
|
31
|
+
* ๐ Simplified inflectors
|
|
32
|
+
* ๐ Upload field support (S3/MinIO)
|
|
33
|
+
* ๐ i18n support via `graphile-i18n`
|
|
34
|
+
* ๐ง Meta schema plugin
|
|
35
|
+
* ๐ Graphile search plugin
|
|
36
|
+
* Smart schema and plugin configuration via environment or options
|
|
37
|
+
* Express-compatible with support for request-aware context
|
|
38
|
+
|
|
39
|
+
## ๐ฆ Usage
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { getGraphileSettings } from 'graphile-settings';
|
|
43
|
+
import { postgraphile } from 'postgraphile';
|
|
44
|
+
import express from 'express';
|
|
45
|
+
|
|
46
|
+
const app = express();
|
|
47
|
+
|
|
48
|
+
const settings = getGraphileSettings({
|
|
49
|
+
server: {
|
|
50
|
+
port: 5000,
|
|
51
|
+
host: '0.0.0.0',
|
|
52
|
+
strictAuth: true,
|
|
53
|
+
},
|
|
54
|
+
graphile: {
|
|
55
|
+
schema: ['app_public'],
|
|
56
|
+
metaSchemas: ['meta_public'],
|
|
57
|
+
},
|
|
58
|
+
features: {
|
|
59
|
+
postgis: true,
|
|
60
|
+
simpleInflection: true,
|
|
61
|
+
oppositeBaseNames: true,
|
|
62
|
+
},
|
|
63
|
+
cdn: {
|
|
64
|
+
bucketName: 'media-bucket',
|
|
65
|
+
awsRegion: 'us-west-1',
|
|
66
|
+
awsAccessKey: 'AKIA...',
|
|
67
|
+
awsSecretKey: 'secret',
|
|
68
|
+
minioEndpoint: 'http://localhost:9000'
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
app.use(postgraphile({
|
|
73
|
+
...settings,
|
|
74
|
+
pgPool: myPool // your initialized pg.Pool
|
|
75
|
+
}));
|
|
76
|
+
|
|
77
|
+
app.listen(settings.port);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## ๐งฐ Configuration Options
|
|
81
|
+
|
|
82
|
+
### `LaunchQLOptions`
|
|
83
|
+
|
|
84
|
+
#### `server`
|
|
85
|
+
|
|
86
|
+
* `port` โ (number) Port to use
|
|
87
|
+
* `host` โ (string) Hostname
|
|
88
|
+
* `trustProxy` โ (boolean) Whether to trust proxy headers (e.g. for real IPs)
|
|
89
|
+
* `origin` โ (string) Origin for CORS/auth logic
|
|
90
|
+
* `strictAuth` โ (boolean) Whether to enforce strict auth
|
|
91
|
+
|
|
92
|
+
#### `graphile`
|
|
93
|
+
|
|
94
|
+
* `schema` โ (string or string\[]) Required list of main GraphQL schemas
|
|
95
|
+
* `metaSchemas` โ (string\[]) Optional list of meta/introspection schemas
|
|
96
|
+
* `isPublic` โ (boolean) Flag for public GraphQL instance
|
|
97
|
+
* `appendPlugins` โ (Plugin\[]) Additional Graphile plugins
|
|
98
|
+
* `graphileBuildOptions` โ (PostGraphileOptions.graphileBuildOptions) Extra build options
|
|
99
|
+
* `overrideSettings` โ (Partial<PostGraphileOptions>) Manual overrides of generated config
|
|
100
|
+
|
|
101
|
+
#### `features`
|
|
102
|
+
|
|
103
|
+
* `simpleInflection` โ Use simplified inflection (e.g. `fooByBarId`)
|
|
104
|
+
* `oppositeBaseNames` โ Enable smart reverse relation names
|
|
105
|
+
* `postgis` โ Enable PostGIS and filter plugin
|
|
106
|
+
|
|
107
|
+
#### `cdn`
|
|
108
|
+
|
|
109
|
+
* `bucketName` โ Required for upload plugin (S3 or MinIO)
|
|
110
|
+
* `awsRegion` โ AWS region
|
|
111
|
+
* `awsAccessKey` โ Access key for upload
|
|
112
|
+
* `awsSecretKey` โ Secret key
|
|
113
|
+
* `minioEndpoint` โ Optional override for MinIO compatibility
|
|
114
|
+
|
|
115
|
+
## ๐ Included Plugins
|
|
116
|
+
|
|
117
|
+
* `postgraphile-plugin-connection-filter`
|
|
118
|
+
* `@pyramation/postgraphile-plugin-fulltext-filter`
|
|
119
|
+
* `@pyramation/postgis`
|
|
120
|
+
* `postgraphile-plugin-connection-filter-postgis`
|
|
121
|
+
* `postgraphile-derived-upload-field`
|
|
122
|
+
* `graphile-simple-inflector`
|
|
123
|
+
* `graphile-i18n`
|
|
124
|
+
* `graphile-meta-schema`
|
|
125
|
+
* `@graphile-contrib/pg-many-to-many`
|
|
126
|
+
* `graphile-search-plugin`
|
|
127
|
+
* `./plugins/types` (custom LaunchQL plugin)
|
|
128
|
+
|
|
15
129
|
## Related LaunchQL Tooling
|
|
16
130
|
|
|
17
131
|
### ๐งช Testing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-settings",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "graphile settings",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@graphile-contrib/pg-many-to-many": "^1.0.2",
|
|
34
|
-
"@launchql/types": "^2.1.
|
|
34
|
+
"@launchql/types": "^2.1.6",
|
|
35
35
|
"@launchql/upload-names": "^2.1.3",
|
|
36
36
|
"@pyramation/postgis": "^0.1.1",
|
|
37
37
|
"@pyramation/postgraphile-plugin-fulltext-filter": "^2.0.0",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"graphile-build": "^4.14.1",
|
|
41
41
|
"graphile-i18n": "^0.0.3",
|
|
42
42
|
"graphile-meta-schema": "^0.2.5",
|
|
43
|
-
"graphile-query": "^2.1.
|
|
43
|
+
"graphile-query": "^2.1.6",
|
|
44
44
|
"graphile-search-plugin": "^0.1.2",
|
|
45
|
-
"graphile-settings": "^2.1.
|
|
45
|
+
"graphile-settings": "^2.1.9",
|
|
46
46
|
"graphile-simple-inflector": "^0.1.1",
|
|
47
47
|
"graphql-tag": "2.12.6",
|
|
48
48
|
"lru-cache": "^11.1.0",
|
|
@@ -62,5 +62,12 @@
|
|
|
62
62
|
"nodemon": "^3.1.10",
|
|
63
63
|
"ts-node": "^10.9.2"
|
|
64
64
|
},
|
|
65
|
-
"
|
|
65
|
+
"keywords": [
|
|
66
|
+
"graphile",
|
|
67
|
+
"settings",
|
|
68
|
+
"configuration",
|
|
69
|
+
"launchql",
|
|
70
|
+
"graphql"
|
|
71
|
+
],
|
|
72
|
+
"gitHead": "cc4675c134273a66b11a881d084d04362f6837af"
|
|
66
73
|
}
|