graphile-upload-plugin 0.2.0 โ 0.2.2
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 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -8,19 +8,29 @@
|
|
|
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-upload-plugin">
|
|
15
|
+
<img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql?filename=graphile%2Fgraphile-upload-plugin%2Fpackage.json"/>
|
|
16
|
+
</a>
|
|
13
17
|
</p>
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
**`graphile-upload-plugin`** adds an `Upload` scalar and upload field resolvers for PostGraphile, letting you store uploaded metadata in PostgreSQL columns.
|
|
16
20
|
|
|
17
|
-
##
|
|
21
|
+
## ๐ Installation
|
|
18
22
|
|
|
19
23
|
```bash
|
|
20
24
|
pnpm add graphile-upload-plugin
|
|
21
25
|
```
|
|
22
26
|
|
|
23
|
-
##
|
|
27
|
+
## โจ Features
|
|
28
|
+
|
|
29
|
+
- Adds the `Upload` scalar to PostGraphile
|
|
30
|
+
- Supports upload resolvers by type or smart comment tag
|
|
31
|
+
- Flexible resolver hook to store files anywhere (S3, local, etc.)
|
|
32
|
+
|
|
33
|
+
## ๐ฆ Usage
|
|
24
34
|
|
|
25
35
|
```ts
|
|
26
36
|
import express from 'express';
|
|
@@ -55,7 +65,7 @@ app.use(
|
|
|
55
65
|
);
|
|
56
66
|
```
|
|
57
67
|
|
|
58
|
-
## Configuration
|
|
68
|
+
## ๐ง Configuration
|
|
59
69
|
|
|
60
70
|
The plugin accepts `uploadFieldDefinitions` in `graphileBuildOptions`:
|
|
61
71
|
|
|
@@ -64,6 +74,13 @@ The plugin accepts `uploadFieldDefinitions` in `graphileBuildOptions`:
|
|
|
64
74
|
|
|
65
75
|
Each definition requires a `resolve` function that processes the upload and returns the value to store in the database.
|
|
66
76
|
|
|
77
|
+
## ๐งช Testing
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
# requires a local Postgres available (defaults to postgres/password@localhost:5432)
|
|
81
|
+
pnpm --filter graphile-upload-plugin test
|
|
82
|
+
```
|
|
83
|
+
|
|
67
84
|
---
|
|
68
85
|
|
|
69
86
|
## Education and Tutorials
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-upload-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Graphile upload plugin for PostGraphile",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/launchql/launchql",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"@launchql/env": "^2.5.6",
|
|
43
43
|
"@launchql/s3-utils": "^2.2.10",
|
|
44
44
|
"@types/pg": "^8.15.2",
|
|
45
|
-
"graphile-test": "^2.8.
|
|
45
|
+
"graphile-test": "^2.8.11",
|
|
46
46
|
"graphql-tag": "^2.12.6",
|
|
47
47
|
"makage": "^0.1.6",
|
|
48
|
-
"pgsql-test": "^2.14.
|
|
48
|
+
"pgsql-test": "^2.14.14",
|
|
49
49
|
"ts-jest": "^29.1.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"graphile-build": "^4.14.1",
|
|
55
55
|
"graphql": "15.10.1"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "00c90828cab8d3e306ebb2bc6053aab4aa9ae807"
|
|
58
58
|
}
|