MichalLytek / MichalLytek/typegraphql-prisma

Issue with generating the resolvers in outputs

Open
#454 6 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
TypeScript
Stars
918
Forks
130
PR merge metrics
No merged PRs in 30d

Description

**Incorectly generating the rosolvers**
i have used this same prisma schema at typegraphql-prisma version (0.27.1) but now when use current version 0.27.2 , i am facing the issue generating the resolvers.
```
generator typegraphql {
provider = "typegraphql-prisma"
output = "../generated/type-graphql"
emitTranspiledCode = false
}
```

**To Reproduce**
![2024-06-06-171042_screenshot](https://github.com/MichalLytek/typegraphql-prisma/assets/133015290/72b455b4-a268-48e3-b646-bf84412ea55e)

its generating this path
```
api/generated/type-graphql/resolvers/outputs/CreateManyChatsAndReturnOutputType.ts

```
and in this return outputType files this kind of modules are not resolving
```
import { Folder } from "../outputs/Folder";
```
but previous version that i have used i didn't get generate this files please resolve my issue

**Expected Behavior**
![2024-06-06-171118_screenshot](https://github.com/MichalLytek/typegraphql-prisma/assets/133015290/da0e2fbd-fff2-4554-a005-1e093a7a8c11)

See i have used typegraphql-prisma: "0.27.1"

**Logs**
```
at _buildSchemaBin (file:///home/dharmendraboddeda/Projects/promanager/conversation-explorer-new/node_modules/@multiplatform.one/typegraphql/lib/chunk-SNLZTJW7.mjs:22:41) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///home/dharmendraboddeda/Projects/promanager/conversation-explorer-new/api/dist/api/main.mjs'
}

Node.js v20.12.1
node:internal/modules/cjs/loader:1146
throw err;
^

Error: Cannot find module '/home/dharmendraboddeda/Projects/promanager/conversation-explorer-new/api/dist/api/main.mjs'
at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v20.12.1
Could not resolve "../outputs/Folder" from "generated/type-graphql/resolvers/outputs/CreateManyChatsAndReturnOutputType.ts"
file: /home/dharmendraboddeda/Projects/promanager/conversation-explorer-new/api/generated/type-graphql/resolvers/outputs/CreateManyChatsAndReturnOutputType.ts

```

**Environment (please complete the following information):**

- OS: debian
- Node : 20.12.1
- `typegraphql-prisma` version [0.27.2]
- Prisma version [5.8.1]
- TypeScript version (5.3.3)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the generator configuration and the generated file api/generated/type-graphql/resolvers/outputs/CreateManyChatsAndReturnOutputType.ts. Reproduce with typegraphql-prisma 0.27.2, Prisma 5.8.1, TypeScript 5.3.3, and Node 20.12.1, then inspect why its ../outputs/Folder import cannot be resolved and compare the output with version 0.27.1; done means generated resolvers resolve and load successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
backend-api-design, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.