graphile-presigned-url-plugin 1.19.1 → 1.20.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/esm/plugin.js +3 -2
- package/package.json +6 -6
- package/plugin.js +3 -2
package/esm/plugin.js
CHANGED
|
@@ -89,12 +89,13 @@ export function createPresignedUrlPlugin(options) {
|
|
|
89
89
|
const { scope: { isRootMutation }, } = context;
|
|
90
90
|
if (!isRootMutation)
|
|
91
91
|
return fields;
|
|
92
|
-
const { graphql: { GraphQLString, GraphQLNonNull, GraphQLInt, GraphQLBoolean, GraphQLObjectType, GraphQLInputObjectType, GraphQLList, }, } = build;
|
|
92
|
+
const { graphql: { GraphQLString, GraphQLNonNull, GraphQLInt, GraphQLBoolean, GraphQLObjectType, GraphQLInputObjectType, GraphQLList, isOutputType, }, } = build;
|
|
93
93
|
// The projection document is jsonb-shaped. PostGraphile registers a JSON
|
|
94
94
|
// scalar whenever the schema has a jsonb column, which any storage-equipped
|
|
95
95
|
// database does; if it is absent the payload simply omits the field rather
|
|
96
96
|
// than failing schema build over a field nothing can have asked for yet.
|
|
97
|
-
const
|
|
97
|
+
const jsonNamedType = build.getTypeByName('JSON');
|
|
98
|
+
const jsonType = jsonNamedType && isOutputType(jsonNamedType) ? jsonNamedType : null;
|
|
98
99
|
if (!jsonType) {
|
|
99
100
|
log.warn('No JSON scalar in this schema; upload payloads will omit the `file` projection');
|
|
100
101
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-presigned-url-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "Presigned URL upload plugin for PostGraphile v5 — requestUploadUrl mutation and downloadUrl computed field",
|
|
5
5
|
"author": "Constructive <developers@constructive.io>",
|
|
6
6
|
"homepage": "https://github.com/constructive-io/constructive",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@aws-sdk/client-s3": "^3.1052.0",
|
|
44
44
|
"@aws-sdk/s3-request-presigner": "^3.1052.0",
|
|
45
|
-
"@pgpmjs/logger": "^2.
|
|
45
|
+
"@pgpmjs/logger": "^2.26.0",
|
|
46
46
|
"@pgsql/quotes": "^18.2.4",
|
|
47
47
|
"graphile-plugin-utils": "^1.12.2",
|
|
48
|
-
"graphile-storage-registry": "^0.
|
|
48
|
+
"graphile-storage-registry": "^0.2.0",
|
|
49
49
|
"lru-cache": "^11.2.7",
|
|
50
|
-
"mime-bytes": "^0.
|
|
50
|
+
"mime-bytes": "^0.33.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"grafast": "^1.1.1",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"postgraphile": "^5.1.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@constructive-io/s3-utils": "^2.
|
|
62
|
+
"@constructive-io/s3-utils": "^2.34.0",
|
|
63
63
|
"@types/node": "^22.19.11",
|
|
64
64
|
"makage": "^0.8.0"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "baa84094b8541eb5000701b0060aa5b298032dc7"
|
|
67
67
|
}
|
package/plugin.js
CHANGED
|
@@ -93,12 +93,13 @@ function createPresignedUrlPlugin(options) {
|
|
|
93
93
|
const { scope: { isRootMutation }, } = context;
|
|
94
94
|
if (!isRootMutation)
|
|
95
95
|
return fields;
|
|
96
|
-
const { graphql: { GraphQLString, GraphQLNonNull, GraphQLInt, GraphQLBoolean, GraphQLObjectType, GraphQLInputObjectType, GraphQLList, }, } = build;
|
|
96
|
+
const { graphql: { GraphQLString, GraphQLNonNull, GraphQLInt, GraphQLBoolean, GraphQLObjectType, GraphQLInputObjectType, GraphQLList, isOutputType, }, } = build;
|
|
97
97
|
// The projection document is jsonb-shaped. PostGraphile registers a JSON
|
|
98
98
|
// scalar whenever the schema has a jsonb column, which any storage-equipped
|
|
99
99
|
// database does; if it is absent the payload simply omits the field rather
|
|
100
100
|
// than failing schema build over a field nothing can have asked for yet.
|
|
101
|
-
const
|
|
101
|
+
const jsonNamedType = build.getTypeByName('JSON');
|
|
102
|
+
const jsonType = jsonNamedType && isOutputType(jsonNamedType) ? jsonNamedType : null;
|
|
102
103
|
if (!jsonType) {
|
|
103
104
|
log.warn('No JSON scalar in this schema; upload payloads will omit the `file` projection');
|
|
104
105
|
}
|