graphile-settings 4.18.6 → 4.18.7
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/esm/plugins/meta-schema/graphql-meta-field.js +1 -0
- package/esm/plugins/meta-schema/type-mappings.js +6 -0
- package/esm/plugins/meta-schema/types.d.ts +5 -0
- package/package.json +3 -3
- package/plugins/meta-schema/graphql-meta-field.js +1 -0
- package/plugins/meta-schema/type-mappings.js +6 -0
- package/plugins/meta-schema/types.d.ts +5 -0
|
@@ -35,6 +35,10 @@ const PG_TO_GQL_TYPE = {
|
|
|
35
35
|
export function pgTypeToGqlType(pgTypeName) {
|
|
36
36
|
return PG_TO_GQL_TYPE[pgTypeName] || pgTypeName;
|
|
37
37
|
}
|
|
38
|
+
function getGeometrySubtype(attr) {
|
|
39
|
+
const subtype = attr?.extensions?.geometrySubtype;
|
|
40
|
+
return typeof subtype === 'string' ? subtype : null;
|
|
41
|
+
}
|
|
38
42
|
function resolveGqlTypeName(build, codec) {
|
|
39
43
|
if (!codec)
|
|
40
44
|
return 'unknown';
|
|
@@ -60,6 +64,7 @@ export function buildFieldMeta(name, attr, build, options) {
|
|
|
60
64
|
const pgType = attr?.codec?.name || 'unknown';
|
|
61
65
|
const isNotNull = attr?.notNull || false;
|
|
62
66
|
const hasDefault = attr?.hasDefault || false;
|
|
67
|
+
const subtype = getGeometrySubtype(attr);
|
|
63
68
|
return {
|
|
64
69
|
name,
|
|
65
70
|
type: {
|
|
@@ -68,6 +73,7 @@ export function buildFieldMeta(name, attr, build, options) {
|
|
|
68
73
|
isArray: !!attr?.codec?.arrayOfCodec,
|
|
69
74
|
isNotNull,
|
|
70
75
|
hasDefault,
|
|
76
|
+
subtype,
|
|
71
77
|
},
|
|
72
78
|
isNotNull,
|
|
73
79
|
hasDefault,
|
|
@@ -26,6 +26,7 @@ export interface TypeMeta {
|
|
|
26
26
|
isArray: boolean;
|
|
27
27
|
isNotNull?: boolean;
|
|
28
28
|
hasDefault?: boolean;
|
|
29
|
+
subtype?: string | null;
|
|
29
30
|
}
|
|
30
31
|
export interface IndexMeta {
|
|
31
32
|
name: string;
|
|
@@ -130,11 +131,15 @@ export interface PgCodec {
|
|
|
130
131
|
};
|
|
131
132
|
};
|
|
132
133
|
}
|
|
134
|
+
export interface PgAttributeExtensions extends Record<string, unknown> {
|
|
135
|
+
geometrySubtype?: string | null;
|
|
136
|
+
}
|
|
133
137
|
export interface PgAttribute {
|
|
134
138
|
codec?: PgCodec | null;
|
|
135
139
|
notNull?: boolean;
|
|
136
140
|
hasDefault?: boolean;
|
|
137
141
|
description?: string | null;
|
|
142
|
+
extensions?: PgAttributeExtensions | null;
|
|
138
143
|
}
|
|
139
144
|
export interface PgUnique {
|
|
140
145
|
attributes: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-settings",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.7",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "graphile settings",
|
|
6
6
|
"main": "index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"graphile-build-pg": "5.0.0",
|
|
48
48
|
"graphile-config": "1.0.0",
|
|
49
49
|
"graphile-connection-filter": "^1.3.6",
|
|
50
|
-
"graphile-postgis": "^2.9.
|
|
50
|
+
"graphile-postgis": "^2.9.8",
|
|
51
51
|
"graphile-search": "^1.5.7",
|
|
52
52
|
"graphile-sql-expression-validator": "^2.6.2",
|
|
53
53
|
"graphile-upload-plugin": "^2.5.2",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"constructive",
|
|
81
81
|
"graphql"
|
|
82
82
|
],
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "f1a0d4315e0f23ba6b8299a7dc2ddceab465d24d"
|
|
84
84
|
}
|
|
@@ -18,6 +18,7 @@ function createMetaSchemaType() {
|
|
|
18
18
|
isArray: { type: nn(graphql_1.GraphQLBoolean) },
|
|
19
19
|
isNotNull: { type: graphql_1.GraphQLBoolean },
|
|
20
20
|
hasDefault: { type: graphql_1.GraphQLBoolean },
|
|
21
|
+
subtype: { type: graphql_1.GraphQLString },
|
|
21
22
|
}),
|
|
22
23
|
});
|
|
23
24
|
const MetaFieldType = new graphql_1.GraphQLObjectType({
|
|
@@ -39,6 +39,10 @@ const PG_TO_GQL_TYPE = {
|
|
|
39
39
|
function pgTypeToGqlType(pgTypeName) {
|
|
40
40
|
return PG_TO_GQL_TYPE[pgTypeName] || pgTypeName;
|
|
41
41
|
}
|
|
42
|
+
function getGeometrySubtype(attr) {
|
|
43
|
+
const subtype = attr?.extensions?.geometrySubtype;
|
|
44
|
+
return typeof subtype === 'string' ? subtype : null;
|
|
45
|
+
}
|
|
42
46
|
function resolveGqlTypeName(build, codec) {
|
|
43
47
|
if (!codec)
|
|
44
48
|
return 'unknown';
|
|
@@ -64,6 +68,7 @@ function buildFieldMeta(name, attr, build, options) {
|
|
|
64
68
|
const pgType = attr?.codec?.name || 'unknown';
|
|
65
69
|
const isNotNull = attr?.notNull || false;
|
|
66
70
|
const hasDefault = attr?.hasDefault || false;
|
|
71
|
+
const subtype = getGeometrySubtype(attr);
|
|
67
72
|
return {
|
|
68
73
|
name,
|
|
69
74
|
type: {
|
|
@@ -72,6 +77,7 @@ function buildFieldMeta(name, attr, build, options) {
|
|
|
72
77
|
isArray: !!attr?.codec?.arrayOfCodec,
|
|
73
78
|
isNotNull,
|
|
74
79
|
hasDefault,
|
|
80
|
+
subtype,
|
|
75
81
|
},
|
|
76
82
|
isNotNull,
|
|
77
83
|
hasDefault,
|
|
@@ -26,6 +26,7 @@ export interface TypeMeta {
|
|
|
26
26
|
isArray: boolean;
|
|
27
27
|
isNotNull?: boolean;
|
|
28
28
|
hasDefault?: boolean;
|
|
29
|
+
subtype?: string | null;
|
|
29
30
|
}
|
|
30
31
|
export interface IndexMeta {
|
|
31
32
|
name: string;
|
|
@@ -130,11 +131,15 @@ export interface PgCodec {
|
|
|
130
131
|
};
|
|
131
132
|
};
|
|
132
133
|
}
|
|
134
|
+
export interface PgAttributeExtensions extends Record<string, unknown> {
|
|
135
|
+
geometrySubtype?: string | null;
|
|
136
|
+
}
|
|
133
137
|
export interface PgAttribute {
|
|
134
138
|
codec?: PgCodec | null;
|
|
135
139
|
notNull?: boolean;
|
|
136
140
|
hasDefault?: boolean;
|
|
137
141
|
description?: string | null;
|
|
142
|
+
extensions?: PgAttributeExtensions | null;
|
|
138
143
|
}
|
|
139
144
|
export interface PgUnique {
|
|
140
145
|
attributes: string[];
|