graphile-pg-type-mappings 0.2.0 โ 0.2.1
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 +24 -10
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -16,9 +16,22 @@
|
|
|
16
16
|
</a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
**`graphile-pg-type-mappings`** is a Graphile/PostGraphile plugin that maps custom PostgreSQL types to GraphQL scalars.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
## ๐ Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install graphile-pg-type-mappings
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## โจ Features
|
|
28
|
+
|
|
29
|
+
- Sensible defaults for common custom Postgres types (`email`, `origin`, `multiple_select`, etc.)
|
|
30
|
+
- Override or extend mappings via `customTypeMappings`
|
|
31
|
+
- Works with PostGraphile v4 as a standard plugin
|
|
32
|
+
- TypeScript definitions for mapping configuration
|
|
33
|
+
|
|
34
|
+
### Default mappings
|
|
22
35
|
|
|
23
36
|
- `email` โ `String`
|
|
24
37
|
- `hostname` โ `String`
|
|
@@ -29,13 +42,7 @@ This plugin provides custom type mappings for PostgreSQL types to GraphQL types,
|
|
|
29
42
|
|
|
30
43
|
> **Note:** If you need PostGIS types (like `geolocation` or `geopolygon` โ `GeoJSON`), you can add them via `customTypeMappings` when using the PostGIS plugin.
|
|
31
44
|
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npm install graphile-pg-type-mappings
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Usage
|
|
45
|
+
## ๐ฆ Usage
|
|
39
46
|
|
|
40
47
|
### Basic Usage (Default Mappings)
|
|
41
48
|
|
|
@@ -132,7 +139,7 @@ const postgraphileOptions = {
|
|
|
132
139
|
};
|
|
133
140
|
```
|
|
134
141
|
|
|
135
|
-
## API
|
|
142
|
+
## ๐ API
|
|
136
143
|
|
|
137
144
|
### `CustomPgTypeMappingsPlugin`
|
|
138
145
|
|
|
@@ -156,6 +163,13 @@ interface CustomPgTypeMappingsPluginOptions {
|
|
|
156
163
|
}
|
|
157
164
|
```
|
|
158
165
|
|
|
166
|
+
## ๐งช Testing
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
# requires a local Postgres available (defaults to postgres/password@localhost:5432)
|
|
170
|
+
pnpm --filter graphile-pg-type-mappings test
|
|
171
|
+
```
|
|
172
|
+
|
|
159
173
|
---
|
|
160
174
|
|
|
161
175
|
## Education and Tutorials
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-pg-type-mappings",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Custom PostgreSQL type mappings plugin for Graphile/PostGraphile",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/launchql/launchql",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"url": "https://github.com/launchql/launchql/issues"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"graphile-postgis": "^0.1.
|
|
43
|
-
"graphile-test": "^2.8.
|
|
42
|
+
"graphile-postgis": "^0.1.3",
|
|
43
|
+
"graphile-test": "^2.8.11",
|
|
44
44
|
"graphql-tag": "2.12.6",
|
|
45
45
|
"makage": "^0.1.6",
|
|
46
|
-
"pgsql-test": "^2.14.
|
|
46
|
+
"pgsql-test": "^2.14.14"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"graphile-build": "^4.14.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "00c90828cab8d3e306ebb2bc6053aab4aa9ae807"
|
|
52
52
|
}
|