Skip to content

Arbitrary include is allowed by type checking even when the model has no relation field. #2488

@jiashengguo

Description

@jiashengguo
model Dummy {
    id   Int    @id @default(autoincrement())
    name String
}

Then the below query code could pass the typechecking, and runtime will throw error:

  const dummies = await db.dummy.findMany({
    include: {
      abcdefg: true,
    },
  });

For this case it's better to not allow to use include at all, which is consistent with v2 behavior

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions