Replies: 2 comments
-
I'm also facing the same problem. :( |
Beta Was this translation helpful? Give feedback.
0 replies
-
This looks like an issue with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to implement csv upload ( timestamp: String, activePower: Float, energy: Float) using nodejs, apollo graphql.
Implementation:
typeDefs.js
model:
index.js
resolver: CSVData.js
packages:
"apollo-server": "^3.5.0",
"apollo-server-errors": "^3.3.1",
"apollo-server-express": "^3.13.0",
"bcryptjs": "^2.4.3",
"csv-parse": "^5.5.6",
"csv-parser": "^3.0.0",
"express": "^4.19.2",
"graphql": "^16.8.2",
"graphql-upload": "^13.0.0",
"jsonwebtoken": "^9.0.2",
"mongoose": "^6.13.0",
"multer": "^1.4.5-lts.1",
"nodemon": "^2.0.22"
Issue:
When I hit the api using postman and console "createReadStream, filename, mimetype, encoding": all of them are undefined.
I get an error: createReadStream is not a function. To avoid this , I replaced
const { createReadStream, filename, mimetype, encoding } = await file;
with
const { stream, filename, mimetype, encoding } = await file;
Then I get another error: parse is not a function
My graphql-upload version is 13.0.0. I am not able to use latest version of graphql-upload( [v14.0.0] No "main" export in package.json causes import failures jaydenseric/graphql-upload#305 (comment)) . I tried following https://stackoverflow.com/questions/72361047/error-no-exports-main-defined-in-graphql-upload-package-json but had no success. I think it works woth Typescript and I am using Javascript.
I am not able to understand the reason for any of the above issues, I am following the official documentation but not able to understand where exactly is the problem.
Any help would be greatly appreciated. :)
Beta Was this translation helpful? Give feedback.
All reactions