Cauen / prisma-generator-pothos-codegen

The fastest way to create a fully customizable CRUD Graphql API from Prisma Schema.
https://www.npmjs.com/package/prisma-generator-pothos-codegen
95 stars 16 forks source link

Type errors occur when using pnpm #62

Closed mmm888 closed 8 months ago

mmm888 commented 8 months ago

Hello. Thank you for the useful library.

When using pnpm, the following type errors occur. There were no issues with npm or yarn. Is pnpm supported?

cd examples/input-simple-sqlite/
pnpm install
pnpm type # it fails
Cauen commented 8 months ago

Hi @mmm888 Can you show more informations about the errors?

mmm888 commented 8 months ago

There seem to be three patterns.

Screen Shot 2023-12-22 at 12 44 41 Screen Shot 2023-12-22 at 12 44 55 Screen Shot 2023-12-22 at 12 43 43

==========

The output result of pnpm type is as follows.

$ yarn type
yarn run v1.22.21
$ tsc --noEmit
src/schema/__generated__/Comment/mutations/createMany.base.ts:14:73 - error TS2322: Type '{ id?: number | null | undefined; authorId: number; comment: string; postId: number; }' is not assignable to type '(Without<CommentCreateInput, CommentUncheckedCreateInput> & CommentUncheckedCreateInput) | (Without<...> & CommentCreateInput)'.
  Type '{ id?: number | null | undefined; authorId: number; comment: string; postId: number; }' is not assignable to type 'Without<CommentCreateInput, CommentUncheckedCreateInput> & CommentUncheckedCreateInput'.
    Type '{ id?: number | null | undefined; authorId: number; comment: string; postId: number; }' is not assignable to type 'CommentUncheckedCreateInput'.
      Types of property 'id' are incompatible.
        Type 'number | null | undefined' is not assignable to type 'number | undefined'.

14       await db.$transaction(args.data.map((data) => db.comment.create({ data }))),
                                                                           ~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6320:5
    6320     data: XOR<CommentCreateInput, CommentUncheckedCreateInput>
             ~~~~
    The expected type comes from property 'data' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; data: (Without<...> & CommentUncheckedCreateInput) | (Without<...> & CommentCreateInput); }'

src/schema/__generated__/Comment/mutations/createOne.base.ts:14:7 - error TS2322: Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; }>' is not assignable to type 'MaybePromise<readonly unknown[]> | null | undefined'.
  Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; }>' is not assignable to type 'Promise<readonly unknown[]>'.
    Type '{ id: number; comment: string; authorId: number; postId: number; }' is missing the following properties from type 'readonly unknown[]': length, concat, join, slice, and 19 more.

14       await db.comment.create({ data: args.data, ...query }),
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/.pnpm/@pothos+plugin-prisma@3.63.0_@pothos+core@3.40.1_@prisma+client@5.7.1_graphql@16.8.1_typescript@5.3.3/node_modules/@pothos/plugin-prisma/dts/types.d.ts:168:224
    168 export type PrismaFieldResolver<Types extends SchemaTypes, Model extends PrismaModelTypes, Parent, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveReturnShape> = (query: {
                                                                                                                                                                                                                                       ~~~~~~~~~
    169     include?: Model['Include'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    170     select?: Model['Select'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    171 }, parent: Parent, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [Shape] extends [[readonly (infer Item)[] | null | undefined]] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/schema/__generated__/Comment/mutations/createOne.base.ts:14:33 - error TS2322: Type '{ id?: number | null | undefined; authorId: number; comment: string; postId: number; }' is not assignable to type '(Without<CommentCreateInput, CommentUncheckedCreateInput> & CommentUncheckedCreateInput) | (Without<...> & CommentCreateInput)'.

14       await db.comment.create({ data: args.data, ...query }),
                                   ~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6320:5
    6320     data: XOR<CommentCreateInput, CommentUncheckedCreateInput>
             ~~~~
    The expected type comes from property 'data' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; data: (Without<...> & CommentUncheckedCreateInput) | (Without<...> & CommentCreateInput); }'

src/schema/__generated__/Comment/mutations/deleteMany.base.ts:15:37 - error TS2322: Type '{ id?: number | { equals?: number | { name: string; modelName: "Comment"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; notIn?: number[] | null | undefined; ... 4 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 7 more ...; postId?: number | ....' is not assignable to type 'CommentWhereInput'.
  Types of property 'AND' are incompatible.
    Type '{ id?: number | { equals?: number | { name: string; modelName: "Comment"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; notIn?: number[] | null | undefined; ... 4 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 7 more ...; postId?: number | ....' is not assignable to type 'CommentWhereInput | CommentWhereInput[] | undefined'.
      Type 'null' is not assignable to type 'CommentWhereInput | CommentWhereInput[] | undefined'.

15       await db.comment.deleteMany({ where: args.where }),
                                       ~~~~~

src/schema/__generated__/Comment/mutations/deleteOne.base.ts:14:7 - error TS2322: Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; }>' is not assignable to type 'MaybePromise<readonly unknown[]> | null | undefined'.
  Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; }>' is not assignable to type 'Promise<readonly unknown[]>'.
    Type '{ id: number; comment: string; authorId: number; postId: number; }' is not assignable to type 'readonly unknown[]'.

14       await db.comment.delete({ where: args.where, ...query }),
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/.pnpm/@pothos+plugin-prisma@3.63.0_@pothos+core@3.40.1_@prisma+client@5.7.1_graphql@16.8.1_typescript@5.3.3/node_modules/@pothos/plugin-prisma/dts/types.d.ts:168:224
    168 export type PrismaFieldResolver<Types extends SchemaTypes, Model extends PrismaModelTypes, Parent, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveReturnShape> = (query: {
                                                                                                                                                                                                                                       ~~~~~~~~~
    169     include?: Model['Include'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    170     select?: Model['Select'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    171 }, parent: Parent, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [Shape] extends [[readonly (infer Item)[] | null | undefined]] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/schema/__generated__/Comment/mutations/deleteOne.base.ts:14:33 - error TS2322: Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput'.
  Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput'.
    Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type '{ id: number; } & { id?: number | undefined; AND?: CommentWhereInput | CommentWhereInput[] | undefined; OR?: CommentWhereInput[] | undefined; ... 5 more ...; Post?: (Without<...> & PostWhereInput) | ... 1 more ... | undefined; }'.
      Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type '{ id: number; }'.
        Types of property 'id' are incompatible.
          Type 'number | null | undefined' is not assignable to type 'number'.
            Type 'undefined' is not assignable to type 'number'.

14       await db.comment.delete({ where: args.where, ...query }),
                                   ~~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6404:5
    6404     where: CommentWhereUniqueInput
             ~~~~~
    The expected type comes from property 'where' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; where: CommentWhereUniqueInput; }'

src/schema/__generated__/Comment/mutations/updateMany.base.ts:18:37 - error TS2322: Type '{ id?: number | { equals?: number | { name: string; modelName: "Comment"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; notIn?: number[] | null | undefined; ... 4 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 7 more ...; postId?: number | ....' is not assignable to type 'CommentWhereInput | undefined'.
  Type '{ id?: number | { equals?: number | { name: string; modelName: "Comment"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; notIn?: number[] | null | undefined; ... 4 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 7 more ...; postId?: number | ....' is not assignable to type 'CommentWhereInput'.

18       await db.comment.updateMany({ where: args.where || undefined, data: args.data }),
                                       ~~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6358:5
    6358     where?: CommentWhereInput
             ~~~~~
    The expected type comes from property 'where' which is declared here on type '{ data: (Without<CommentUpdateManyMutationInput, CommentUncheckedUpdateManyInput> & CommentUncheckedUpdateManyInput) | (Without<...> & CommentUpdateManyMutationInput); where?: CommentWhereInput | undefined; }'

src/schema/__generated__/Comment/mutations/updateMany.base.ts:18:69 - error TS2322: Type '{ comment?: { set?: string | null | undefined; } | null | undefined; }' is not assignable to type '(Without<CommentUpdateManyMutationInput, CommentUncheckedUpdateManyInput> & CommentUncheckedUpdateManyInput) | (Without<...> & CommentUpdateManyMutationInput)'.
  Type '{ comment?: { set?: string | null | undefined; } | null | undefined; }' is not assignable to type 'Without<CommentUncheckedUpdateManyInput, CommentUpdateManyMutationInput> & CommentUpdateManyMutationInput'.
    Type '{ comment?: { set?: string | null | undefined; } | null | undefined; }' is not assignable to type 'CommentUpdateManyMutationInput'.
      Types of property 'comment' are incompatible.
        Type '{ set?: string | null | undefined; } | null | undefined' is not assignable to type 'string | StringFieldUpdateOperationsInput | undefined'.

18       await db.comment.updateMany({ where: args.where || undefined, data: args.data }),
                                                                       ~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6354:5
    6354     data: XOR<CommentUpdateManyMutationInput, CommentUncheckedUpdateManyInput>
             ~~~~
    The expected type comes from property 'data' which is declared here on type '{ data: (Without<CommentUpdateManyMutationInput, CommentUncheckedUpdateManyInput> & CommentUncheckedUpdateManyInput) | (Without<...> & CommentUpdateManyMutationInput); where?: CommentWhereInput | undefined; }'

src/schema/__generated__/Comment/mutations/updateOne.base.ts:17:7 - error TS2322: Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; }>' is not assignable to type 'MaybePromise<readonly unknown[]> | null | undefined'.

17       await db.comment.update({ where: args.where, data: args.data, ...query }),
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/.pnpm/@pothos+plugin-prisma@3.63.0_@pothos+core@3.40.1_@prisma+client@5.7.1_graphql@16.8.1_typescript@5.3.3/node_modules/@pothos/plugin-prisma/dts/types.d.ts:168:224
    168 export type PrismaFieldResolver<Types extends SchemaTypes, Model extends PrismaModelTypes, Parent, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveReturnShape> = (query: {
                                                                                                                                                                                                                                       ~~~~~~~~~
    169     include?: Model['Include'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    170     select?: Model['Select'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    171 }, parent: Parent, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [Shape] extends [[readonly (infer Item)[] | null | undefined]] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/schema/__generated__/Comment/mutations/updateOne.base.ts:17:33 - error TS2322: Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput'.

17       await db.comment.update({ where: args.where, data: args.data, ...query }),
                                   ~~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6343:5
    6343     where: CommentWhereUniqueInput
             ~~~~~
    The expected type comes from property 'where' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; data: (Without<...> & CommentUncheckedUpdateInput) | (Without<...> & CommentUpdateInput); where: CommentWhereUniqueInput; }'

src/schema/__generated__/Comment/mutations/updateOne.base.ts:17:52 - error TS2322: Type '{ id?: { set?: number | null | undefined; increment?: number | null | undefined; decrement?: number | null | undefined; multiply?: number | null | undefined; divide?: number | null | undefined; } | null | undefined; authorId?: { ...; } | ... 1 more ... | undefined; comment?: { ...; } | ... 1 more ... | undefined; po...' is not assignable to type '(Without<CommentUpdateInput, CommentUncheckedUpdateInput> & CommentUncheckedUpdateInput) | (Without<...> & CommentUpdateInput)'.
  Type '{ id?: { set?: number | null | undefined; increment?: number | null | undefined; decrement?: number | null | undefined; multiply?: number | null | undefined; divide?: number | null | undefined; } | null | undefined; authorId?: { ...; } | ... 1 more ... | undefined; comment?: { ...; } | ... 1 more ... | undefined; po...' is not assignable to type 'Without<CommentUncheckedUpdateInput, CommentUpdateInput> & CommentUpdateInput'.
    Type '{ id?: { set?: number | null | undefined; increment?: number | null | undefined; decrement?: number | null | undefined; multiply?: number | null | undefined; divide?: number | null | undefined; } | null | undefined; authorId?: { ...; } | ... 1 more ... | undefined; comment?: { ...; } | ... 1 more ... | undefined; po...' is not assignable to type 'Without<CommentUncheckedUpdateInput, CommentUpdateInput>'.
      Types of property 'id' are incompatible.
        Type '{ set?: number | null | undefined; increment?: number | null | undefined; decrement?: number | null | undefined; multiply?: number | null | undefined; divide?: number | null | undefined; } | null | undefined' is not assignable to type 'undefined'.
          Type 'null' is not assignable to type 'undefined'.

17       await db.comment.update({ where: args.where, data: args.data, ...query }),
                                                      ~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6339:5
    6339     data: XOR<CommentUpdateInput, CommentUncheckedUpdateInput>
             ~~~~
    The expected type comes from property 'data' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; data: (Without<...> & CommentUncheckedUpdateInput) | (Without<...> & CommentUpdateInput); where: CommentWhereUniqueInput; }'

src/schema/__generated__/Comment/mutations/upsertOne.base.ts:18:7 - error TS2322: Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; }>' is not assignable to type 'MaybePromise<readonly unknown[]> | null | undefined'.

 18       await db.comment.upsert({
          ~~~~~~~~~~~~~~~~~~~~~~~~~
 19         where: args.where,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
...
 22         ...query,
    ~~~~~~~~~~~~~~~~~
 23       }),
    ~~~~~~~~

  node_modules/.pnpm/@pothos+plugin-prisma@3.63.0_@pothos+core@3.40.1_@prisma+client@5.7.1_graphql@16.8.1_typescript@5.3.3/node_modules/@pothos/plugin-prisma/dts/types.d.ts:168:224
    168 export type PrismaFieldResolver<Types extends SchemaTypes, Model extends PrismaModelTypes, Parent, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveReturnShape> = (query: {
                                                                                                                                                                                                                                       ~~~~~~~~~
    169     include?: Model['Include'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    170     select?: Model['Select'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    171 }, parent: Parent, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [Shape] extends [[readonly (infer Item)[] | null | undefined]] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/schema/__generated__/Comment/mutations/upsertOne.base.ts:19:9 - error TS2322: Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput'.

19         where: args.where,
           ~~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6377:5
    6377     where: CommentWhereUniqueInput
             ~~~~~
    The expected type comes from property 'where' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; where: CommentWhereUniqueInput; create: (Without<...> & CommentUncheckedCreateInput) | (Without<...> & CommentCreateInput); update: (Without<...> & CommentUncheckedUpdateInput) | (Without<...> & Commen...'

src/schema/__generated__/Comment/mutations/upsertOne.base.ts:20:9 - error TS2322: Type '{ id?: number | null | undefined; authorId: number; comment: string; postId: number; }' is not assignable to type '(Without<CommentCreateInput, CommentUncheckedCreateInput> & CommentUncheckedCreateInput) | (Without<...> & CommentCreateInput)'.

20         create: args.create,
           ~~~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6381:5
    6381     create: XOR<CommentCreateInput, CommentUncheckedCreateInput>
             ~~~~~~
    The expected type comes from property 'create' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; where: CommentWhereUniqueInput; create: (Without<...> & CommentUncheckedCreateInput) | (Without<...> & CommentCreateInput); update: (Without<...> & CommentUncheckedUpdateInput) | (Without<...> & Commen...'

src/schema/__generated__/Comment/mutations/upsertOne.base.ts:21:9 - error TS2322: Type '{ id?: { set?: number | null | undefined; increment?: number | null | undefined; decrement?: number | null | undefined; multiply?: number | null | undefined; divide?: number | null | undefined; } | null | undefined; authorId?: { ...; } | ... 1 more ... | undefined; comment?: { ...; } | ... 1 more ... | undefined; po...' is not assignable to type '(Without<CommentUpdateInput, CommentUncheckedUpdateInput> & CommentUncheckedUpdateInput) | (Without<...> & CommentUpdateInput)'.

21         update: args.update,
           ~~~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6385:5
    6385     update: XOR<CommentUpdateInput, CommentUncheckedUpdateInput>
             ~~~~~~
    The expected type comes from property 'update' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; where: CommentWhereUniqueInput; create: (Without<...> & CommentUncheckedCreateInput) | (Without<...> & CommentCreateInput); update: (Without<...> & CommentUncheckedUpdateInput) | (Without<...> & Commen...'

src/schema/__generated__/Comment/queries/count.base.ts:22:9 - error TS2322: Type '{ id?: number | { equals?: number | { name: string; modelName: "Comment"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; notIn?: number[] | null | undefined; ... 4 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 7 more ...; postId?: number | ....' is not assignable to type 'CommentWhereInput | undefined'.

22         where: args.where || undefined,
           ~~~~~

src/schema/__generated__/Comment/queries/count.base.ts:23:9 - error TS2322: Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput | undefined'.

23         cursor: args.cursor || undefined,
           ~~~~~~

src/schema/__generated__/Comment/queries/count.base.ts:26:9 - error TS2322: Type '{ id?: NonNullable<SortOrder | undefined> | null | undefined; Post?: { id?: NonNullable<SortOrder | undefined> | null | undefined; ... 4 more ...; authorId?: NonNullable<...> | ... 1 more ... | undefined; } | null | undefined; Author?: { ...; } | ... 1 more ... | undefined; authorId?: NonNullable<...> | ... 1 more ....' is not assignable to type 'CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] | undefined'.

26         orderBy: args.orderBy || undefined,
           ~~~~~~~

src/schema/__generated__/Comment/queries/findFirst.base.ts:21:7 - error TS2322: Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; } | null>' is not assignable to type 'MaybePromise<readonly unknown[]> | null | undefined'.
  Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; } | null>' is not assignable to type 'Promise<readonly unknown[]>'.
    Type '{ id: number; comment: string; authorId: number; postId: number; } | null' is not assignable to type 'readonly unknown[]'.
      Type 'null' is not assignable to type 'readonly unknown[]'.

 21       await db.comment.findFirst({
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 22         where: args.where || undefined,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
 28         ...query,
    ~~~~~~~~~~~~~~~~~
 29       }),
    ~~~~~~~~

  node_modules/.pnpm/@pothos+plugin-prisma@3.63.0_@pothos+core@3.40.1_@prisma+client@5.7.1_graphql@16.8.1_typescript@5.3.3/node_modules/@pothos/plugin-prisma/dts/types.d.ts:168:224
    168 export type PrismaFieldResolver<Types extends SchemaTypes, Model extends PrismaModelTypes, Parent, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveReturnShape> = (query: {
                                                                                                                                                                                                                                       ~~~~~~~~~
    169     include?: Model['Include'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    170     select?: Model['Select'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    171 }, parent: Parent, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [Shape] extends [[readonly (infer Item)[] | null | undefined]] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/schema/__generated__/Comment/queries/findFirst.base.ts:22:9 - error TS2322: Type '{ id?: number | { equals?: number | { name: string; modelName: "Comment"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; notIn?: number[] | null | undefined; ... 4 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 7 more ...; postId?: number | ....' is not assignable to type 'CommentWhereInput | undefined'.

22         where: args.where || undefined,
           ~~~~~

src/schema/__generated__/Comment/queries/findFirst.base.ts:23:9 - error TS2322: Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput | undefined'.
  Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput | undefined'.
    Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type '{ id: number; } & { id?: number | undefined; AND?: CommentWhereInput | CommentWhereInput[] | undefined; OR?: CommentWhereInput[] | undefined; ... 5 more ...; Post?: (Without<...> & PostWhereInput) | ... 1 more ... | undefined; }'.

23         cursor: args.cursor || undefined,
           ~~~~~~

src/schema/__generated__/Comment/queries/findFirst.base.ts:27:9 - error TS2322: Type '{ id?: NonNullable<SortOrder | undefined> | null | undefined; Post?: { id?: NonNullable<SortOrder | undefined> | null | undefined; ... 4 more ...; authorId?: NonNullable<...> | ... 1 more ... | undefined; } | null | undefined; Author?: { ...; } | ... 1 more ... | undefined; authorId?: NonNullable<...> | ... 1 more ....' is not assignable to type 'CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] | undefined'.
  Type '{ id?: NonNullable<SortOrder | undefined> | null | undefined; Post?: { id?: NonNullable<SortOrder | undefined> | null | undefined; ... 4 more ...; authorId?: NonNullable<...> | ... 1 more ... | undefined; } | null | undefined; Author?: { ...; } | ... 1 more ... | undefined; authorId?: NonNullable<...> | ... 1 more ....' is not assignable to type 'CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] | undefined'.
    Type '{ id?: NonNullable<SortOrder | undefined> | null | undefined; Post?: { id?: NonNullable<SortOrder | undefined> | null | undefined; ... 4 more ...; authorId?: NonNullable<...> | ... 1 more ... | undefined; } | null | undefined; Author?: { ...; } | ... 1 more ... | undefined; authorId?: NonNullable<...> | ... 1 more ....' is not assignable to type 'CommentOrderByWithRelationInput[]'.
      Type '{ id?: NonNullable<SortOrder | undefined> | null | undefined; Post?: { id?: NonNullable<SortOrder | undefined> | null | undefined; ... 4 more ...; authorId?: NonNullable<...> | ... 1 more ... | undefined; } | null | undefined; Author?: { ...; } | ... 1 more ... | undefined; authorId?: NonNullable<...> | ... 1 more ....' is not assignable to type 'CommentOrderByWithRelationInput'.
        Types of property 'id' are incompatible.
          Type 'NonNullable<SortOrder | undefined> | null | undefined' is not assignable to type 'SortOrder | undefined'.

27         orderBy: args.orderBy || undefined,
           ~~~~~~~

src/schema/__generated__/Comment/queries/findMany.base.ts:22:9 - error TS2322: Type '{ id?: number | { equals?: number | { name: string; modelName: "Comment"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; notIn?: number[] | null | undefined; ... 4 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 7 more ...; postId?: number | ....' is not assignable to type 'CommentWhereInput | undefined'.

22         where: args.where || undefined,
           ~~~~~

src/schema/__generated__/Comment/queries/findMany.base.ts:23:9 - error TS2322: Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput | undefined'.

23         cursor: args.cursor || undefined,
           ~~~~~~

src/schema/__generated__/Comment/queries/findMany.base.ts:27:9 - error TS2322: Type '{ id?: NonNullable<SortOrder | undefined> | null | undefined; Post?: { id?: NonNullable<SortOrder | undefined> | null | undefined; ... 4 more ...; authorId?: NonNullable<...> | ... 1 more ... | undefined; } | null | undefined; Author?: { ...; } | ... 1 more ... | undefined; authorId?: NonNullable<...> | ... 1 more ....' is not assignable to type 'CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] | undefined'.

27         orderBy: args.orderBy || undefined,
           ~~~~~~~

src/schema/__generated__/Comment/queries/findUnique.base.ts:14:7 - error TS2322: Type 'Promise<{ id: number; comment: string; authorId: number; postId: number; } | null>' is not assignable to type 'MaybePromise<readonly unknown[]> | null | undefined'.

14       await db.comment.findUnique({ where: args.where, ...query }),
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/.pnpm/@pothos+plugin-prisma@3.63.0_@pothos+core@3.40.1_@prisma+client@5.7.1_graphql@16.8.1_typescript@5.3.3/node_modules/@pothos/plugin-prisma/dts/types.d.ts:168:224
    168 export type PrismaFieldResolver<Types extends SchemaTypes, Model extends PrismaModelTypes, Parent, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveReturnShape> = (query: {
                                                                                                                                                                                                                                       ~~~~~~~~~
    169     include?: Model['Include'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    170     select?: Model['Select'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    171 }, parent: Parent, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [Shape] extends [[readonly (infer Item)[] | null | undefined]] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/schema/__generated__/Comment/queries/findUnique.base.ts:14:37 - error TS2322: Type '{ id?: number | null | undefined; Post?: { id?: number | { equals?: number | { name: string; modelName: "Post"; isList: boolean; typeName: "Int"; } | null | undefined; in?: number[] | null | undefined; ... 5 more ...; not?: number | ... 2 more ... | undefined; } | null | undefined; ... 9 more ...; isNot?: null | und...' is not assignable to type 'CommentWhereUniqueInput'.

14       await db.comment.findUnique({ where: args.where, ...query }),
                                       ~~~~~

  node_modules/.pnpm/@prisma+client@5.7.1_prisma@5.7.1/node_modules/.prisma/client/index.d.ts:6140:5
    6140     where: CommentWhereUniqueInput
             ~~~~~
    The expected type comes from property 'where' which is declared here on type '{ select?: CommentSelect<DefaultArgs> | null | undefined; include?: CommentInclude<DefaultArgs> | null | undefined; where: CommentWhereUniqueInput; }'

==========
(snipping...)
==========

src/schema/builder.ts:12:27 - error TS2694: Namespace '"/mnt/tmp/prisma-generator-pothos-codegen/node_modules/.prisma/client/index".Prisma' has no exported member 'Decimal'.

12   Scalars: Scalars<Prisma.Decimal, Prisma.InputJsonValue | null, Prisma.InputJsonValue>;
                             ~~~~~~~

src/schema/builder.ts:12:43 - error TS2694: Namespace '"/mnt/tmp/prisma-generator-pothos-codegen/node_modules/.prisma/client/index".Prisma' has no exported member 'InputJsonValue'.

12   Scalars: Scalars<Prisma.Decimal, Prisma.InputJsonValue | null, Prisma.InputJsonValue>;
                                             ~~~~~~~~~~~~~~

src/schema/builder.ts:12:73 - error TS2694: Namespace '"/mnt/tmp/prisma-generator-pothos-codegen/node_modules/.prisma/client/index".Prisma' has no exported member 'InputJsonValue'.

12   Scalars: Scalars<Prisma.Decimal, Prisma.InputJsonValue | null, Prisma.InputJsonValue>;
                                                                           ~~~~~~~~~~~~~~

Found 236 errors in 98 files.

Errors  Files
     1  src/schema/__generated__/Comment/mutations/createMany.base.ts:14
     2  src/schema/__generated__/Comment/mutations/createOne.base.ts:14
     1  src/schema/__generated__/Comment/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/Comment/mutations/deleteOne.base.ts:14
     2  src/schema/__generated__/Comment/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/Comment/mutations/updateOne.base.ts:17
     4  src/schema/__generated__/Comment/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/Comment/queries/count.base.ts:22
     4  src/schema/__generated__/Comment/queries/findFirst.base.ts:21
     3  src/schema/__generated__/Comment/queries/findMany.base.ts:22
     2  src/schema/__generated__/Comment/queries/findUnique.base.ts:14
     1  src/schema/__generated__/ExtraModal/mutations/createMany.base.ts:14
     2  src/schema/__generated__/ExtraModal/mutations/createOne.base.ts:14
     1  src/schema/__generated__/ExtraModal/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/ExtraModal/mutations/deleteOne.base.ts:14
     2  src/schema/__generated__/ExtraModal/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/ExtraModal/mutations/updateOne.base.ts:17
     4  src/schema/__generated__/ExtraModal/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/ExtraModal/queries/count.base.ts:22
     4  src/schema/__generated__/ExtraModal/queries/findFirst.base.ts:21
     3  src/schema/__generated__/ExtraModal/queries/findMany.base.ts:22
     2  src/schema/__generated__/ExtraModal/queries/findUnique.base.ts:14
     1  src/schema/__generated__/Follow/mutations/createOne.base.ts:14
     1  src/schema/__generated__/Follow/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/Follow/mutations/deleteOne.base.ts:14
     1  src/schema/__generated__/Follow/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/Follow/mutations/updateOne.base.ts:17
     3  src/schema/__generated__/Follow/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/Follow/queries/count.base.ts:22
     4  src/schema/__generated__/Follow/queries/findFirst.base.ts:21
     3  src/schema/__generated__/Follow/queries/findMany.base.ts:22
     2  src/schema/__generated__/Follow/queries/findUnique.base.ts:14
     1  src/schema/__generated__/IdOnly/mutations/createMany.base.ts:14
     2  src/schema/__generated__/IdOnly/mutations/createOne.base.ts:14
     1  src/schema/__generated__/IdOnly/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/IdOnly/mutations/deleteOne.base.ts:14
     1  src/schema/__generated__/IdOnly/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/IdOnly/mutations/updateOne.base.ts:17
     4  src/schema/__generated__/IdOnly/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/IdOnly/queries/count.base.ts:22
     4  src/schema/__generated__/IdOnly/queries/findFirst.base.ts:21
     3  src/schema/__generated__/IdOnly/queries/findMany.base.ts:22
     2  src/schema/__generated__/IdOnly/queries/findUnique.base.ts:14
     1  src/schema/__generated__/Post/mutations/createMany.base.ts:14
     2  src/schema/__generated__/Post/mutations/createOne.base.ts:14
     1  src/schema/__generated__/Post/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/Post/mutations/deleteOne.base.ts:14
     2  src/schema/__generated__/Post/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/Post/mutations/updateOne.base.ts:17
     4  src/schema/__generated__/Post/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/Post/queries/count.base.ts:22
     4  src/schema/__generated__/Post/queries/findFirst.base.ts:21
     3  src/schema/__generated__/Post/queries/findMany.base.ts:22
     2  src/schema/__generated__/Post/queries/findUnique.base.ts:14
     1  src/schema/__generated__/Profile/mutations/createMany.base.ts:14
     2  src/schema/__generated__/Profile/mutations/createOne.base.ts:14
     1  src/schema/__generated__/Profile/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/Profile/mutations/deleteOne.base.ts:14
     1  src/schema/__generated__/Profile/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/Profile/mutations/updateOne.base.ts:17
     4  src/schema/__generated__/Profile/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/Profile/queries/count.base.ts:22
     4  src/schema/__generated__/Profile/queries/findFirst.base.ts:21
     3  src/schema/__generated__/Profile/queries/findMany.base.ts:22
     2  src/schema/__generated__/Profile/queries/findUnique.base.ts:14
     1  src/schema/__generated__/Unrelated/mutations/createMany.base.ts:14
     2  src/schema/__generated__/Unrelated/mutations/createOne.base.ts:14
     1  src/schema/__generated__/Unrelated/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/Unrelated/mutations/deleteOne.base.ts:14
     1  src/schema/__generated__/Unrelated/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/Unrelated/mutations/updateOne.base.ts:17
     4  src/schema/__generated__/Unrelated/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/Unrelated/queries/count.base.ts:22
     4  src/schema/__generated__/Unrelated/queries/findFirst.base.ts:21
     3  src/schema/__generated__/Unrelated/queries/findMany.base.ts:22
     2  src/schema/__generated__/Unrelated/queries/findUnique.base.ts:14
     1  src/schema/__generated__/WithScalars/mutations/createMany.base.ts:14
     2  src/schema/__generated__/WithScalars/mutations/createOne.base.ts:14
     1  src/schema/__generated__/WithScalars/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/WithScalars/mutations/deleteOne.base.ts:14
     2  src/schema/__generated__/WithScalars/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/WithScalars/mutations/updateOne.base.ts:17
     4  src/schema/__generated__/WithScalars/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/WithScalars/queries/count.base.ts:22
     4  src/schema/__generated__/WithScalars/queries/findFirst.base.ts:21
     3  src/schema/__generated__/WithScalars/queries/findMany.base.ts:22
     2  src/schema/__generated__/WithScalars/queries/findUnique.base.ts:14
     1  src/schema/__generated__/WithoutID/mutations/createOne.base.ts:14
     1  src/schema/__generated__/WithoutID/mutations/deleteMany.base.ts:15
     2  src/schema/__generated__/WithoutID/mutations/deleteOne.base.ts:14
     2  src/schema/__generated__/WithoutID/mutations/updateMany.base.ts:18
     3  src/schema/__generated__/WithoutID/mutations/updateOne.base.ts:17
     3  src/schema/__generated__/WithoutID/mutations/upsertOne.base.ts:18
     3  src/schema/__generated__/WithoutID/queries/count.base.ts:22
     4  src/schema/__generated__/WithoutID/queries/findFirst.base.ts:21
     3  src/schema/__generated__/WithoutID/queries/findMany.base.ts:22
     2  src/schema/__generated__/WithoutID/queries/findUnique.base.ts:14
     3  src/schema/builder.ts:12
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Cauen commented 8 months ago

Hi @mmm888 The first error seems like you've updated @pothos/₢ore the lib to unsupported version Latest release of prisma-generator-pothos-codegen can no support it Can you please update and check again?

About the error 2 and 3: I think its caused because the project was unable to find the generated Prisma Client. If you try to use prisma, you probably will get a typescript error

mmm888 commented 8 months ago

It is strange that just changing from yarn to pnpm would cause this error.

git clone https://github.com/Cauen/prisma-generator-pothos-codegen
cd prisma-generator-pothos-codegen
yarn install
cd examples/inputs-simple-sqlite

yarn install
yarn migrate
yarn type # OK

rm node_modules -rf
rm prisma/dev.db* -f
pnpm install
pnpm migrate
pnpm type # The above errors occur

However, for some reason, when I put the generated prisma code outside of the node_modules directory, it worked.

$ git diff examples/inputs-simple-sqlite/prisma/schema.prisma
diff --git a/examples/inputs-simple-sqlite/prisma/schema.prisma b/examples/inputs-simple-sqlite/prisma/schema.prisma
index e1a349e..62242c6 100644
--- a/examples/inputs-simple-sqlite/prisma/schema.prisma
+++ b/examples/inputs-simple-sqlite/prisma/schema.prisma
@@ -5,12 +5,14 @@ datasource db {

 generator client {
   provider = "prisma-client-js"
+  output = "../src/generated/prisma/client"
 }

 generator pothos {
   provider     = "prisma-pothos-types"
   // Match client output location from above
-  clientOutput = ".prisma/client"
+  //clientOutput = ".prisma/client"
+  clientOutput = "../src/generated/prisma/client"
   output       = "../src/generated/objects.d.ts"
 }
$ git diff examples/inputs-simple-sqlite/src/schema/configs.js
diff --git a/examples/inputs-simple-sqlite/src/schema/configs.js b/examples/inputs-simple-sqlite/src/schema/configs.js
index 1ec8b5b..03cf0bc 100644
--- a/examples/inputs-simple-sqlite/src/schema/configs.js
+++ b/examples/inputs-simple-sqlite/src/schema/configs.js
@@ -16,11 +16,13 @@ module.exports = {
     inputsImporter: "import * as Inputs from '@/schema/__generated__/inputs'",
     deleteOutputDirBeforeGenerate: true,
     exportEverythingInObjectsDotTs: false,
-    prismaImporter: `import { Prisma } from '@prisma/client';`,
+    //prismaImporter: `import { Prisma } from '@prisma/client';`,
+    prismaImporter: `import { Prisma } from '@/generated/prisma/client';`,
     resolverImports: `\nimport { db } from '@/db';`,
   },
   inputs: {
-    prismaImporter: `import { Prisma } from '@prisma/client';`,
+    //prismaImporter: `import { Prisma } from '@prisma/client';`,
+    prismaImporter: `import { Prisma } from '@/generated/prisma/client';`,
     outputFilePath: './src/schema/__generated__/inputs.ts',
     simple: true,
   },
Cauen commented 8 months ago

Are these errors specifically linked to this codegen? Does everything work normally outside of the generated files? Both in Pothos and in Prisma?

If that is the case, can you please share a minimal reproducible example?

mmm888 commented 8 months ago

I tested with User Model only. > https://github.com/mmm888/prisma-generator-pothos-codegen-issue62

$ git clone https://github.com/mmm888/prisma-generator-pothos-codegen-issue62
$ cd prisma-generator-pothos-codegen-issue62/
$ yarn install
$ yarn generate
$ yarn type
yarn run v1.22.21
$ tsc --noEmit
Done in 2.11s.

$ rm node_modules/ -rf
$ pnpm install
$ pnpm generate
$ pnpm type

> prisma-generator-pothos-codegen-issue62@1.0.0 type /mnt/tmp/tmp/prisma-generator-pothos-codegen-issue62
> tsc --noEmit

src/__generated__/User/mutations/createOne.base.ts:14:7 - error TS2322: Type 'Promise<{ id: number; name: string; }>' is not assignable to type 'MaybePromise<readonly unknown[]> | null | undefined'.
  Type 'Promise<{ id: number; name: string; }>' is not assignable to type 'Promise<readonly unknown[]>'.
    Type '{ id: number; name: string; }' is missing the following properties from type 'readonly unknown[]': length, concat, join, slice, and 20 more.

14       await prisma.user.create({ data: args.data, ...query }),
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/.pnpm/@pothos+plugin-prisma@3.63.0_@pothos+core@3.41.0_@prisma+client@5.7.1_graphql@16.8.1_typescript@5.3.3/node_modules/@pothos/plugin-prisma/dts/types.d.ts:168:224
    168 export type PrismaFieldResolver<Types extends SchemaTypes, Model extends PrismaModelTypes, Parent, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveReturnShape> = (query: {
                                                                                                                                                                                                                                       ~~~~~~~~~
    169     include?: Model['Include'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    170     select?: Model['Select'];
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    171 }, parent: Parent, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [Shape] extends [[readonly (infer Item)[] | null | undefined]] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

==========
(snipping...)
==========

src/schema.ts:13:13 - error TS2322: Type '(_query: { include?: undefined; select?: any; }, _root: {}, _args: InputShapeFromFields<InputFieldMap>, _ctx: {}, _info: GraphQLResolveInfo) => Promise<...>' is not assignable to type 'PrismaFieldResolver<ExtendDefaultTypes<{ PrismaTypes: PrismaTypes; }>, PrismaModelTypes & { Name: "User"; Shape: User; Include: never; Select: Prisma.UserSelect; OrderBy: Prisma.UserOrderByWithRelationInput; ... 6 more ...; Relations: {}; }, ... 4 more ..., Promise<...>>'.
  Type 'Promise<{ id: number; name: string; }>' is not assignable to type 'MaybePromise<readonly unknown[]> | null | undefined'.

13             resolve: async (_query, _root, _args, _ctx, _info) => {
               ~~~~~~~

  node_modules/.pnpm/@pothos+plugin-prisma@3.63.0_@pothos+core@3.41.0_@prisma+client@5.7.1_graphql@16.8.1_typescript@5.3.3/node_modules/@pothos/plugin-prisma/dts/types.d.ts:159:5
    159     resolve: FieldOptions extends {
            ~~~~~~~
    The expected type comes from property 'resolve' which is declared here on type 'Omit<QueryFieldOptions<ExtendDefaultTypes<{ PrismaTypes: PrismaTypes; }>, ObjectRef<any, any>, FieldNullability<ObjectRef<any, any>>, InputFieldMap, Promise<...>>, "resolve" | "type"> & { ...; }'

Found 7 errors in 7 files.

Errors  Files
     1  src/__generated__/User/mutations/createOne.base.ts:14
     1  src/__generated__/User/mutations/deleteOne.base.ts:14
     1  src/__generated__/User/mutations/updateOne.base.ts:17
     1  src/__generated__/User/mutations/upsertOne.base.ts:18
     1  src/__generated__/User/queries/findFirst.base.ts:21
     1  src/__generated__/User/queries/findUnique.base.ts:14
     1  src/schema.ts:13
 ELIFECYCLE  Command failed with exit code 2.

The same error occurred here as well, so it seemed that the problem was occurring around the Prisma Plugin for Pothos.

I don't think this is a problem with prisma-generator-pothos-codegen, so I will close this issue. Thank you for checking.