@constructive-io/graphql-server 2.12.0 → 2.14.0
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 +23 -23
- package/esm/middleware/flush.js +1 -1
- package/middleware/flush.js +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -33,13 +33,13 @@ import { GraphQLServer } from '@constructive-io/graphql-server';
|
|
|
33
33
|
GraphQLServer(
|
|
34
34
|
getEnvOptions({
|
|
35
35
|
pg: { database: 'constructive_db' },
|
|
36
|
-
server: { host: '0.0.0.0', port: 3000 }
|
|
36
|
+
server: { host: '0.0.0.0', port: 3000 },
|
|
37
37
|
})
|
|
38
38
|
);
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
> **Tip:** Set `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, `PGDATABASE` to control DB connectivity.
|
|
42
|
-
See [Configuration](#configuration) for the full list of supported env vars and defaults.
|
|
42
|
+
> See [Configuration](#configuration) for the full list of supported env vars and defaults.
|
|
43
43
|
|
|
44
44
|
### Local Development (this repo)
|
|
45
45
|
|
|
@@ -50,9 +50,9 @@ pnpm dev
|
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
This starts the server with env defaults from `@constructive-io/graphql-env`.
|
|
53
|
-
> **Tip:** Set `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, `PGDATABASE` to control DB connectivity.
|
|
54
|
-
See [Configuration](#configuration) for the full list of supported env vars and defaults.
|
|
55
53
|
|
|
54
|
+
> **Tip:** Set `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, `PGDATABASE` to control DB connectivity.
|
|
55
|
+
> See [Configuration](#configuration) for the full list of supported env vars and defaults.
|
|
56
56
|
|
|
57
57
|
## What it does
|
|
58
58
|
|
|
@@ -79,7 +79,7 @@ Runs an Express server that wires CORS, uploads, domain parsing, auth, and PostG
|
|
|
79
79
|
|
|
80
80
|
When `API_ENABLE_META=true` (default):
|
|
81
81
|
|
|
82
|
-
- The server resolves APIs from `
|
|
82
|
+
- The server resolves APIs from `services_public.domains` using the request host.
|
|
83
83
|
- Only APIs where `api.is_public` matches `API_IS_PUBLIC` are served.
|
|
84
84
|
- In private mode (`API_IS_PUBLIC=false`), you can override with headers:
|
|
85
85
|
- `X-Api-Name` + `X-Database-Id`
|
|
@@ -95,24 +95,24 @@ When `API_ENABLE_META=false`:
|
|
|
95
95
|
|
|
96
96
|
Configuration is merged from defaults, config files, and env vars via `@constructive-io/graphql-env`. See `graphql/env/README.md` for the full list and examples.
|
|
97
97
|
|
|
98
|
-
| Env var
|
|
99
|
-
|
|
|
100
|
-
| `PGHOST`
|
|
101
|
-
| `PGPORT`
|
|
102
|
-
| `PGUSER`
|
|
103
|
-
| `PGPASSWORD`
|
|
104
|
-
| `PGDATABASE`
|
|
105
|
-
| `GRAPHILE_SCHEMA`
|
|
106
|
-
| `FEATURES_SIMPLE_INFLECTION`
|
|
107
|
-
| `FEATURES_OPPOSITE_BASE_NAMES` | Enable opposite base names
|
|
108
|
-
| `FEATURES_POSTGIS`
|
|
109
|
-
| `API_ENABLE_META`
|
|
110
|
-
| `API_IS_PUBLIC`
|
|
111
|
-
| `API_EXPOSED_SCHEMAS`
|
|
112
|
-
| `API_META_SCHEMAS`
|
|
113
|
-
| `API_ANON_ROLE`
|
|
114
|
-
| `API_ROLE_NAME`
|
|
115
|
-
| `API_DEFAULT_DATABASE_ID`
|
|
98
|
+
| Env var | Purpose | Default |
|
|
99
|
+
| ------------------------------ | ------------------------------------- | ------------------------------------------------------------- |
|
|
100
|
+
| `PGHOST` | Postgres host | `localhost` |
|
|
101
|
+
| `PGPORT` | Postgres port | `5432` |
|
|
102
|
+
| `PGUSER` | Postgres user | `postgres` |
|
|
103
|
+
| `PGPASSWORD` | Postgres password | `password` |
|
|
104
|
+
| `PGDATABASE` | Postgres database | `postgres` |
|
|
105
|
+
| `GRAPHILE_SCHEMA` | Comma-separated schemas to expose | empty |
|
|
106
|
+
| `FEATURES_SIMPLE_INFLECTION` | Enable simple inflection | `true` |
|
|
107
|
+
| `FEATURES_OPPOSITE_BASE_NAMES` | Enable opposite base names | `true` |
|
|
108
|
+
| `FEATURES_POSTGIS` | Enable PostGIS support | `true` |
|
|
109
|
+
| `API_ENABLE_META` | Enable meta API routing | `true` |
|
|
110
|
+
| `API_IS_PUBLIC` | Serve public APIs only | `true` |
|
|
111
|
+
| `API_EXPOSED_SCHEMAS` | Schemas when meta routing is disabled | empty |
|
|
112
|
+
| `API_META_SCHEMAS` | Meta schemas to query | `services_public,metaschema_public,metaschema_modules_public` |
|
|
113
|
+
| `API_ANON_ROLE` | Anonymous role name | `administrator` |
|
|
114
|
+
| `API_ROLE_NAME` | Authenticated role name | `administrator` |
|
|
115
|
+
| `API_DEFAULT_DATABASE_ID` | Default database ID | `hard-coded` |
|
|
116
116
|
|
|
117
117
|
## Testing
|
|
118
118
|
|
package/esm/middleware/flush.js
CHANGED
package/middleware/flush.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive GraphQL Server",
|
|
6
6
|
"main": "index.js",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"express": "^5.2.1",
|
|
53
53
|
"graphile-build": "^4.14.1",
|
|
54
54
|
"graphile-cache": "^1.6.14",
|
|
55
|
-
"graphile-i18n": "^0.
|
|
56
|
-
"graphile-meta-schema": "^0.
|
|
57
|
-
"graphile-plugin-connection-filter": "^2.
|
|
58
|
-
"graphile-plugin-connection-filter-postgis": "^1.
|
|
59
|
-
"graphile-plugin-fulltext-filter": "^2.
|
|
55
|
+
"graphile-i18n": "^0.4.0",
|
|
56
|
+
"graphile-meta-schema": "^0.5.0",
|
|
57
|
+
"graphile-plugin-connection-filter": "^2.6.0",
|
|
58
|
+
"graphile-plugin-connection-filter-postgis": "^1.3.0",
|
|
59
|
+
"graphile-plugin-fulltext-filter": "^2.3.0",
|
|
60
60
|
"graphile-query": "^2.4.7",
|
|
61
|
-
"graphile-search-plugin": "^0.
|
|
62
|
-
"graphile-settings": "^2.
|
|
63
|
-
"graphile-simple-inflector": "^0.
|
|
61
|
+
"graphile-search-plugin": "^0.4.0",
|
|
62
|
+
"graphile-settings": "^2.12.0",
|
|
63
|
+
"graphile-simple-inflector": "^0.4.0",
|
|
64
64
|
"graphile-utils": "^4.14.1",
|
|
65
65
|
"graphql": "15.10.1",
|
|
66
66
|
"graphql-tag": "2.12.6",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"nodemon": "^3.1.10",
|
|
84
84
|
"ts-node": "^10.9.2"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "e6171117d5498f38f456dfaf7e8a497dd7d2a30b"
|
|
87
87
|
}
|