MichalLytek / MichalLytek/typegraphql-prisma

Empty Input Type for many to many relationship join tables

Open
#19 20 comments 6 reactions 0 assignees View on GitHub
blocked bug
Dominant language
TypeScript
Stars
918
Forks
130
PR merge metrics
No merged PRs in 30d

Description

After excecute npx prisma generate we have some Input Types that's are empty, so, when i tried to run the nest app i have the following Error:

```
[Nest] 4976 - 2020-10-16 12:59:05 [ExceptionHandler] Some errors occurred while generating GraphQL schema:
Input Object type Sgp_ch_turnos_agenteUpdateManyDataInput must define one or more fields.
```

that's my auto generated file:

```ts
import * as TypeGraphQL from "type-graphql";
import GraphQLJSON from "graphql-type-json";
import { JsonValue, InputJsonValue } from "@prisma/client";

@TypeGraphQL.InputType({
isAbstract: true,
description: undefined,
})
export class Sgp_ch_turnos_agenteUpdateManyDataInput {
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with `npx prisma generate` and inspect the generated `Sgp_ch_turnos_agenteUpdateManyDataInput` class shown in the report. Trace how many-to-many relationship join tables produce this input type; done means generated input types define valid fields and Nest GraphQL schema generation no longer reports an empty input object.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.