graphile-settings 2.6.13 → 2.6.14
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 +8 -5
- package/esm/index.js +4 -7
- package/index.js +6 -9
- package/package.json +13 -14
- package/esm/plugins/types.js +0 -31
- package/plugins/types.d.ts +0 -3
- package/plugins/types.js +0 -33
package/README.md
CHANGED
|
@@ -8,8 +8,12 @@
|
|
|
8
8
|
<a href="https://github.com/launchql/launchql/actions/workflows/run-tests.yaml">
|
|
9
9
|
<img height="20" src="https://github.com/launchql/launchql/actions/workflows/run-tests.yaml/badge.svg" />
|
|
10
10
|
</a>
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
<a href="https://github.com/launchql/launchql/blob/main/LICENSE">
|
|
12
|
+
<img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/>
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/graphile-settings">
|
|
15
|
+
<img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql?filename=graphile%2Fgraphile-settings%2Fpackage.json"/>
|
|
16
|
+
</a>
|
|
13
17
|
</p>
|
|
14
18
|
|
|
15
19
|
**`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.
|
|
@@ -117,14 +121,13 @@ app.listen(settings.port);
|
|
|
117
121
|
* `graphile-plugin-connection-filter`
|
|
118
122
|
* `graphile-plugin-fulltext-filter`
|
|
119
123
|
* `graphile-postgis`
|
|
120
|
-
* `
|
|
121
|
-
* `postgraphile-derived-upload-field`
|
|
124
|
+
* `graphile-plugin-connection-filter-postgis`
|
|
122
125
|
* `graphile-simple-inflector`
|
|
123
126
|
* `graphile-i18n`
|
|
124
127
|
* `graphile-meta-schema`
|
|
125
128
|
* `@graphile-contrib/pg-many-to-many`
|
|
126
129
|
* `graphile-search-plugin`
|
|
127
|
-
*
|
|
130
|
+
* `graphile-pg-type-mappings`
|
|
128
131
|
|
|
129
132
|
---
|
|
130
133
|
|
package/esm/index.js
CHANGED
|
@@ -7,12 +7,9 @@ import { additionalGraphQLContextFromRequest as langAdditional, LangPlugin } fro
|
|
|
7
7
|
import PgMetaschema from 'graphile-meta-schema';
|
|
8
8
|
import PgSearch from 'graphile-search-plugin';
|
|
9
9
|
import PgSimpleInflector from 'graphile-simple-inflector';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
import PgPostgisFilter from 'postgraphile-plugin-connection-filter-postgis';
|
|
15
|
-
import LqlTypesPlugin from './plugins/types';
|
|
10
|
+
import ConnectionFilterPlugin from 'graphile-plugin-connection-filter';
|
|
11
|
+
import PgPostgisFilter from 'graphile-plugin-connection-filter-postgis';
|
|
12
|
+
import CustomPgTypeMappingsPlugin from 'graphile-pg-type-mappings';
|
|
16
13
|
import UploadPostGraphilePlugin, { Uploader } from 'graphile-upload-plugin';
|
|
17
14
|
export const getGraphileSettings = (rawOpts) => {
|
|
18
15
|
const opts = getEnvOptions(rawOpts);
|
|
@@ -29,7 +26,7 @@ export const getGraphileSettings = (rawOpts) => {
|
|
|
29
26
|
const plugins = [
|
|
30
27
|
ConnectionFilterPlugin,
|
|
31
28
|
FulltextFilterPlugin,
|
|
32
|
-
|
|
29
|
+
CustomPgTypeMappingsPlugin,
|
|
33
30
|
UploadPostGraphilePlugin,
|
|
34
31
|
PgMetaschema,
|
|
35
32
|
PgManyToMany,
|
package/index.js
CHANGED
|
@@ -46,12 +46,9 @@ const graphile_i18n_1 = require("graphile-i18n");
|
|
|
46
46
|
const graphile_meta_schema_1 = __importDefault(require("graphile-meta-schema"));
|
|
47
47
|
const graphile_search_plugin_1 = __importDefault(require("graphile-search-plugin"));
|
|
48
48
|
const graphile_simple_inflector_1 = __importDefault(require("graphile-simple-inflector"));
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
const postgraphile_plugin_connection_filter_postgis_1 = __importDefault(require("postgraphile-plugin-connection-filter-postgis"));
|
|
54
|
-
const types_1 = __importDefault(require("./plugins/types"));
|
|
49
|
+
const graphile_plugin_connection_filter_1 = __importDefault(require("graphile-plugin-connection-filter"));
|
|
50
|
+
const graphile_plugin_connection_filter_postgis_1 = __importDefault(require("graphile-plugin-connection-filter-postgis"));
|
|
51
|
+
const graphile_pg_type_mappings_1 = __importDefault(require("graphile-pg-type-mappings"));
|
|
55
52
|
const graphile_upload_plugin_1 = __importStar(require("graphile-upload-plugin"));
|
|
56
53
|
const getGraphileSettings = (rawOpts) => {
|
|
57
54
|
const opts = (0, env_1.getEnvOptions)(rawOpts);
|
|
@@ -66,16 +63,16 @@ const getGraphileSettings = (rawOpts) => {
|
|
|
66
63
|
});
|
|
67
64
|
const resolveUpload = uploader.resolveUpload.bind(uploader);
|
|
68
65
|
const plugins = [
|
|
69
|
-
|
|
66
|
+
graphile_plugin_connection_filter_1.default,
|
|
70
67
|
graphile_plugin_fulltext_filter_1.default,
|
|
71
|
-
|
|
68
|
+
graphile_pg_type_mappings_1.default,
|
|
72
69
|
graphile_upload_plugin_1.default,
|
|
73
70
|
graphile_meta_schema_1.default,
|
|
74
71
|
pg_many_to_many_1.default,
|
|
75
72
|
graphile_search_plugin_1.default,
|
|
76
73
|
];
|
|
77
74
|
if (features?.postgis) {
|
|
78
|
-
plugins.push(graphile_postgis_1.default,
|
|
75
|
+
plugins.push(graphile_postgis_1.default, graphile_plugin_connection_filter_postgis_1.default);
|
|
79
76
|
}
|
|
80
77
|
if (features?.simpleInflection) {
|
|
81
78
|
plugins.push(graphile_simple_inflector_1.default);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-settings",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.14",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "graphile settings",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,24 +35,23 @@
|
|
|
35
35
|
"cors": "^2.8.5",
|
|
36
36
|
"express": "^5.1.0",
|
|
37
37
|
"graphile-build": "^4.14.1",
|
|
38
|
-
"graphile-i18n": "^0.1.
|
|
39
|
-
"graphile-meta-schema": "^0.2.
|
|
40
|
-
"graphile-
|
|
41
|
-
"graphile-plugin-
|
|
42
|
-
"graphile-postgis": "^0.
|
|
43
|
-
"graphile-
|
|
44
|
-
"graphile-
|
|
45
|
-
"graphile-
|
|
46
|
-
"graphile-
|
|
38
|
+
"graphile-i18n": "^0.1.6",
|
|
39
|
+
"graphile-meta-schema": "^0.2.11",
|
|
40
|
+
"graphile-pg-type-mappings": "^0.2.0",
|
|
41
|
+
"graphile-plugin-connection-filter": "^2.3.2",
|
|
42
|
+
"graphile-plugin-connection-filter-postgis": "^1.0.0-alpha.7",
|
|
43
|
+
"graphile-plugin-fulltext-filter": "^2.0.3",
|
|
44
|
+
"graphile-postgis": "^0.1.2",
|
|
45
|
+
"graphile-query": "^2.3.12",
|
|
46
|
+
"graphile-search-plugin": "^0.1.14",
|
|
47
|
+
"graphile-simple-inflector": "^0.1.9",
|
|
48
|
+
"graphile-upload-plugin": "^0.2.1",
|
|
47
49
|
"graphql": "15.10.1",
|
|
48
50
|
"graphql-tag": "2.12.6",
|
|
49
51
|
"graphql-upload": "^13.0.0",
|
|
50
52
|
"lru-cache": "^11.1.0",
|
|
51
53
|
"pg": "^8.16.0",
|
|
52
54
|
"postgraphile": "^4.14.1",
|
|
53
|
-
"postgraphile-derived-upload-field": "^0.0.6",
|
|
54
|
-
"postgraphile-plugin-connection-filter": "^2.0.0",
|
|
55
|
-
"postgraphile-plugin-connection-filter-postgis": "^1.0.0-alpha.6",
|
|
56
55
|
"request-ip": "^3.3.0"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
@@ -71,5 +70,5 @@
|
|
|
71
70
|
"launchql",
|
|
72
71
|
"graphql"
|
|
73
72
|
],
|
|
74
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "4e1ff9771c2b07808a9830281abc24d12c689187"
|
|
75
74
|
}
|
package/esm/plugins/types.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// formerly lql-types.js
|
|
2
|
-
const CustomPgTypeMappingsPlugin = builder => {
|
|
3
|
-
builder.hook('build', (build, _context) => {
|
|
4
|
-
const customMappings = [
|
|
5
|
-
{ name: 'geolocation', namespaceName: 'public', type: 'GeoJSON' },
|
|
6
|
-
{ name: 'geopolygon', namespaceName: 'public', type: 'GeoJSON' },
|
|
7
|
-
{ name: 'email', namespaceName: 'public', type: 'String' },
|
|
8
|
-
{ name: 'hostname', namespaceName: 'public', type: 'String' },
|
|
9
|
-
{ name: 'multiple_select', namespaceName: 'public', type: 'JSON' },
|
|
10
|
-
{ name: 'single_select', namespaceName: 'public', type: 'JSON' },
|
|
11
|
-
{ name: 'origin', namespaceName: 'public', type: 'String' },
|
|
12
|
-
{ name: 'url', namespaceName: 'public', type: 'String' },
|
|
13
|
-
];
|
|
14
|
-
for (const { name, namespaceName, type } of customMappings) {
|
|
15
|
-
const pgType = build.pgIntrospectionResultsByKind.type.find(
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
t => t.name === name && t.namespaceName === namespaceName);
|
|
18
|
-
if (pgType) {
|
|
19
|
-
build.pgRegisterGqlTypeByTypeId(pgType.id, () => {
|
|
20
|
-
const gqlType = build.getTypeByName(type);
|
|
21
|
-
if (!gqlType) {
|
|
22
|
-
throw new Error(`Unknown GraphQL type: ${type}`);
|
|
23
|
-
}
|
|
24
|
-
return gqlType;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return build;
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
export default CustomPgTypeMappingsPlugin;
|
package/plugins/types.d.ts
DELETED
package/plugins/types.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// formerly lql-types.js
|
|
4
|
-
const CustomPgTypeMappingsPlugin = builder => {
|
|
5
|
-
builder.hook('build', (build, _context) => {
|
|
6
|
-
const customMappings = [
|
|
7
|
-
{ name: 'geolocation', namespaceName: 'public', type: 'GeoJSON' },
|
|
8
|
-
{ name: 'geopolygon', namespaceName: 'public', type: 'GeoJSON' },
|
|
9
|
-
{ name: 'email', namespaceName: 'public', type: 'String' },
|
|
10
|
-
{ name: 'hostname', namespaceName: 'public', type: 'String' },
|
|
11
|
-
{ name: 'multiple_select', namespaceName: 'public', type: 'JSON' },
|
|
12
|
-
{ name: 'single_select', namespaceName: 'public', type: 'JSON' },
|
|
13
|
-
{ name: 'origin', namespaceName: 'public', type: 'String' },
|
|
14
|
-
{ name: 'url', namespaceName: 'public', type: 'String' },
|
|
15
|
-
];
|
|
16
|
-
for (const { name, namespaceName, type } of customMappings) {
|
|
17
|
-
const pgType = build.pgIntrospectionResultsByKind.type.find(
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
t => t.name === name && t.namespaceName === namespaceName);
|
|
20
|
-
if (pgType) {
|
|
21
|
-
build.pgRegisterGqlTypeByTypeId(pgType.id, () => {
|
|
22
|
-
const gqlType = build.getTypeByName(type);
|
|
23
|
-
if (!gqlType) {
|
|
24
|
-
throw new Error(`Unknown GraphQL type: ${type}`);
|
|
25
|
-
}
|
|
26
|
-
return gqlType;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return build;
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
exports.default = CustomPgTypeMappingsPlugin;
|