While trying to compile my typescript project with graphql files for deployment on Heroku, I encountered the following error message:
node_modules/@types/graphql-upload/index.d.ts(10,35): error TS2307: Cannot find module 'graphql' or its corresponding type declarations.
My tsconfig.json configuration is as follows:
{
"compilerOptions": {
"outDir": "src",
"rootDir": "src",
"lib": ["ESNext"],
"target": "ES6",
"esModuleInterop": true,
"strict": true,
"types": ["@types/graphql-upload"]
},
"include": ["src/**/*"],
"exclude": [""]
}
Here is a snippet from my package.json:
{
"engines": {
"node": "10.16.0",
"npm": "6.5.0"
},
"scripts": {
"start": "node src/index",
"clean": "rm -rf src",
"build": "tsc",
},
"dependencies": {
"@types/graphql-upload": "^8.0.3",
"@types/node-fetch": "^2.5.7",
"graphql": "^14.7.0",
"graphql-cli": "^3.0.5",
"graphql-import": "^0.7.1",
},
"devDependencies": {
"@types/node": "^14.0.19",
"ts-node": "^8.10.2",
"ts-node-dev": "^1.0.0-pre.50",
"typescript": "^3.9.6"
}
The structure of my file directory is as follows:
src -
generated -
prisma.graphql
resolvers -
Mutation.ts
Query.ts
index.ts
schema.graphql
I am seeking assistance in identifying what I might be missing and how I can resolve this issue.