graphql-upload 17.1.0 → 18.0.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/GraphQLUpload.mjs +8 -7
- package/package.json +8 -14
- package/readme.md +1 -1
package/GraphQLUpload.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
/** @import { FileUpload } from "./processRequest.mjs" */
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { GraphQLError } from "graphql/error";
|
|
6
|
+
import { GraphQLScalarType } from "graphql/type";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
import Upload from "./Upload.mjs";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* A GraphQL scalar `Upload` that can be used in a
|
|
@@ -33,7 +34,7 @@ import Upload from "./Upload.mjs";
|
|
|
33
34
|
* A manually constructed schema with an image upload mutation:
|
|
34
35
|
*
|
|
35
36
|
* ```js
|
|
36
|
-
* import { GraphQLBoolean, GraphQLObjectType, GraphQLSchema } from "graphql";
|
|
37
|
+
* import { GraphQLBoolean, GraphQLObjectType, GraphQLSchema } from "graphql/type";
|
|
37
38
|
* import GraphQLUpload from "graphql-upload/GraphQLUpload.mjs";
|
|
38
39
|
*
|
|
39
40
|
* const schema = new GraphQLSchema({
|
|
@@ -72,14 +73,14 @@ import Upload from "./Upload.mjs";
|
|
|
72
73
|
const GraphQLUpload = new GraphQLScalarType({
|
|
73
74
|
name: "Upload",
|
|
74
75
|
description: "The `Upload` scalar type represents a file upload.",
|
|
75
|
-
|
|
76
|
+
coerceInputValue(value) {
|
|
76
77
|
if (value instanceof Upload) return value.promise;
|
|
77
78
|
throw new GraphQLError("Upload value invalid.");
|
|
78
79
|
},
|
|
79
|
-
|
|
80
|
+
coerceInputLiteral(node) {
|
|
80
81
|
throw new GraphQLError("Upload literal unsupported.", { nodes: node });
|
|
81
82
|
},
|
|
82
|
-
|
|
83
|
+
coerceOutputValue() {
|
|
83
84
|
throw new GraphQLError("Upload serialization unsupported.");
|
|
84
85
|
},
|
|
85
86
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql-upload",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "Middleware and a scalar Upload to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -49,18 +49,12 @@
|
|
|
49
49
|
"./Upload.mjs": "./Upload.mjs"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
|
-
"node": "^
|
|
53
|
-
},
|
|
54
|
-
"devEngines": {
|
|
55
|
-
"runtime": {
|
|
56
|
-
"name": "node",
|
|
57
|
-
"version": "^22.13.0 || ^24.0.0 || >=26.0.0"
|
|
58
|
-
}
|
|
52
|
+
"node": "^22.13.0 || ^24.0.0 || >=26.0.0"
|
|
59
53
|
},
|
|
60
54
|
"peerDependencies": {
|
|
61
|
-
"@types/express": "^
|
|
62
|
-
"@types/koa": "^
|
|
63
|
-
"graphql": "^
|
|
55
|
+
"@types/express": "^5.0.0",
|
|
56
|
+
"@types/koa": "^3.0.0",
|
|
57
|
+
"graphql": "^17.0.0"
|
|
64
58
|
},
|
|
65
59
|
"peerDependenciesMeta": {
|
|
66
60
|
"@types/express": {
|
|
@@ -98,8 +92,8 @@
|
|
|
98
92
|
"prettier": "prettier -c .",
|
|
99
93
|
"eslint": "eslint",
|
|
100
94
|
"types": "tsc -p jsconfig.json",
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"prepublishOnly": "node --run
|
|
95
|
+
"test": "node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 --test-coverage-exclude='**/*.test.*' --test-reporter=spec",
|
|
96
|
+
"check": "node --run prettier && node --run eslint && node --run types && node --run test",
|
|
97
|
+
"prepublishOnly": "node --run check"
|
|
104
98
|
}
|
|
105
99
|
}
|
package/readme.md
CHANGED
|
@@ -50,7 +50,7 @@ The [GraphQL multipart request spec](https://github.com/jaydenseric/graphql-mult
|
|
|
50
50
|
|
|
51
51
|
Supported runtime environments:
|
|
52
52
|
|
|
53
|
-
- [Node.js](https://nodejs.org) versions `^
|
|
53
|
+
- [Node.js](https://nodejs.org) versions `^22.13.0 || ^24.0.0 || >=26.0.0`.
|
|
54
54
|
|
|
55
55
|
Projects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:
|
|
56
56
|
|