typegraphql-prisma icon indicating copy to clipboard operation
typegraphql-prisma copied to clipboard

Prisma 5 - incompatible type for cursor property

Open ramiel opened this issue 11 months ago • 7 comments

Describe the Bug With the new prisma 5 version the type produced by code generation is wrong for the cursor type. This only happens with cursor, not the other properties. In the image below FindManyCaptionArgs comes from the type in the generate file packages/prisma/dist/@generated/resolvers/crud/Caption/args/FindManyCaptionArgs.d.ts

image

To Reproduce Try to use the types generated from the package for find operations

Expected Behavior The type should match

Logs

Type 'import("[...]@generated/resolvers/inputs/CaptionWhereUniqueInput").CaptionWhereUniqueInput | undefined' is not assignable to type 'import("[...]/node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/client/index").Prisma.CaptionWhereUniqueInput | undefined'.
  Type 'CaptionWhereUniqueInput' is not assignable to type 'CaptionWhereUniqueInput | undefined'.
    Type 'CaptionWhereUniqueInput' is not assignable to type '{ id: string | CaptionProjectIdInterimIdTargetLanguageCompoundUniqueInput; projectId_interimId_targetLanguage: string | CaptionProjectIdInterimIdTargetLanguageCompoundUniqueInput; } & { ...; }'.
      Type 'CaptionWhereUniqueInput' is not assignable to type '{ id: string | CaptionProjectIdInterimIdTargetLanguageCompoundUniqueInput; projectId_interimId_targetLanguage: string | CaptionProjectIdInterimIdTargetLanguageCompoundUniqueInput; }'.
        Types of property 'id' are incompatible.
          Type 'string | undefined' is not assignable to type 'string | CaptionProjectIdInterimIdTargetLanguageCompoundUniqueInput'.
            Type 'undefined' is not assignable to type 'string | CaptionProjectIdInterimIdTargetLanguageCompoundUniqueInput'.ts(2322)

Environment (please complete the following information):

  • OS: MacOS
  • Node: 18
  • typegraphql-prisma 0.27.0
  • Prisma version 5.0.0
  • TypeScript version 4.9.5

ramiel avatar Jul 21 '23 09:07 ramiel