Skip to content
Snippets Groups Projects
Commit 3461a775 authored by Yannis Barlas's avatar Yannis Barlas
Browse files

feat(server): use graphql-upload to allow node > 12

parent 8e1d0cc6
No related branches found
No related tags found
2 merge requests!52Docx,!17Graphql api
......@@ -51,6 +51,7 @@
"fs-extra": "^10.0.0",
"graphql-middleware": "^4.0.2",
"graphql-shield": "^7.4.1",
"graphql-upload": "^13.0.0",
"helmet": "^3.22.1",
"http-status-codes": "^1.4.0",
"lodash": "^4.17.20",
......
const { graphqlUploadExpress } = require('graphql-upload')
const createGraphQLServer = require('./graphqlServer')
const api = app => {
......@@ -8,6 +10,8 @@ const api = app => {
}),
)
app.use(graphqlUploadExpress())
const server = createGraphQLServer()
server.applyMiddleware({ app })
}
......
......@@ -33,6 +33,7 @@ const createGraphQLServer = testUserContext => {
const createdLoaders = loaders()
const serverConfig = {
uploads: false,
schema,
context: ({ req, res }) => ({
helpers,
......
......@@ -198,6 +198,7 @@ const uploadFileHandler = (fileStream, filename, mimetype) => {
}
const { bucket } = config.get('fileStorage')
const params = {
Bucket: bucket,
Key: filename, // file name you want to save as
......@@ -409,6 +410,7 @@ const getFileInfo = key => {
}
const { bucket } = config.get('fileStorage')
const params = {
Bucket: bucket,
Key: key,
......@@ -433,6 +435,7 @@ const list = () => {
}
const { bucket } = config.get('fileStorage')
const params = {
Bucket: bucket,
}
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment