I'm making a project with TypeGraphql and i want to implement user profile picture.
When i try to import:
import { GraphQLUpload, FileUpload } from "graphql-upload";
docker container log returns:
src/resolvers/user.resolver.ts(25,43): error TS2307: Cannot find module 'graphql-upload' or its corresponding type declarations. `
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
"skipLibCheck": true,
"sourceMap": true,
"outDir": "./dist",
"moduleResolution": "node",
"removeComments": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"baseUrl": "."
},
"exclude": ["node_modules"],
"include": ["./src/**/*.ts"]
}
I tried to install older versions, but that didn't help.
I'll be glad if you could help me.
Thank you.
The latest graphql-upload version 16.0.0 did not work for me with node 16 typescript. However, downgrading to the previous version 15.0.2 worked with the following replacements,
import GraphQLUpload from 'graphql-upload/GraphQLUpload.js';
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.js';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With