J Giri
07/02/2021, 10:19 AMtypegraphql-prisma . I followed the doc of typegraphql-prisma .
What I installed as per doc of typegraphql-prisma is
npm i -D typegraphql-prisma @types/graphql-fields
npm i graphql-scalars graphql-fields
I also configured the default output folder
generator typegraphql {
provider = "typegraphql-prisma"
output = "../prisma/generated/type-graphql"
}
my tsconfig.json is
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
"sourceMap": true,
"outDir": "./dist",
"moduleResolution": "node",
"declaration": false,
// "esModuleInterop": true,
"composite": false,
"removeComments": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
// "allowSyntheticDefaultImports": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"baseUrl": "."
// "rootDir": "src"
},
"exclude": ["node_modules"],
"include": ["./src/**/*.tsx", "./src/**/*.ts"]
}
But now When i try to start my server with npm start (ts-node src/index.ts). i get the following error
D:\Work\coding\testing\rough\ben_Typegraphql\node_modules\ts-node\src\index.ts:587
return new TSError(diagnosticText, diagnosticCodes);
^
TSError: ⨯ Unable to compile TypeScript:
prisma/generated/type-graphql/models/User.ts:2:1 - error TS6133: 'GraphQLScalars' is declared but its value is never read.
2 import * as GraphQLScalars from "graphql-scalars";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prisma/generated/type-graphql/models/User.ts:3:1 - error TS6133: 'Prisma' is declared but its value is never read.
3 import { Prisma } from "@prisma/client";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prisma/generated/type-graphql/models/User.ts:4:1 - error TS6133: 'DecimalJSScalar' is declared but its value is never read.
4 import { DecimalJSScalar } from "../scalars";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at createTSError (D:\Work\coding\testing\rough\ben_Typegraphql\node_modules\ts-node\src\index.ts:587:12)
at reportTSError (D:\Work\coding\testing\rough\ben_Typegraphql\node_modules\ts-node\src\index.ts:591:19)
at getOutput (D:\Work\coding\testing\rough\ben_Typegraphql\node_modules\ts-node\src\index.ts:921:36)
at Object.compile (D:\Work\coding\testing\rough\ben_Typegraphql\node_modules\ts-node\src\index.ts:1189:32)
at Module.m._compile (D:\Work\coding\testing\rough\ben_Typegraphql\node_modules\ts-node\src\index.ts:1295:42)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.require.extensions.<computed> [as .ts] (D:\Work\coding\testing\rough\ben_Typegraphql\node_modules\ts-node\src\index.ts:1298:12)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)Ryan
07/02/2021, 10:25 AMJ Giri
07/02/2021, 10:28 AMJ Giri
07/02/2021, 10:30 AMoutput = "../prisma/generated/type-graphql" then the issue is gone.
Why is that?Ryan
07/02/2021, 10:31 AMtsconfig has only src in include and not prisma.J Giri
07/02/2021, 10:35 AMtsconfig to make it work with configuring default output folderRyan
07/02/2021, 10:38 AMprisma to include in tsconfig.