graphile-settings 2.1.7 โ†’ 2.1.8

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.
Files changed (2) hide show
  1. package/README.md +114 -0
  2. package/package.json +3 -3
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.7",
3
+ "version": "2.1.8",
4
4
  "author": "Dan Lynch <pyramation@gmail.com>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -42,7 +42,7 @@
42
42
  "graphile-meta-schema": "^0.2.5",
43
43
  "graphile-query": "^2.1.5",
44
44
  "graphile-search-plugin": "^0.1.2",
45
- "graphile-settings": "^2.1.7",
45
+ "graphile-settings": "^2.1.8",
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,5 @@
62
62
  "nodemon": "^3.1.10",
63
63
  "ts-node": "^10.9.2"
64
64
  },
65
- "gitHead": "8a638ef47a175c964a63431017d83587e62efbb8"
65
+ "gitHead": "8ceee394ded669254551bd0275b340f2c39bdb10"
66
66
  }