update: support prisma version 6.19 - #494
Conversation
| cwdDirPath + "/generated/type-graphql", | ||
| ); | ||
|
|
||
| expect(prismaGenerateResult.stderr).toHaveLength(0); |
There was a problem hiding this comment.
Prisma is really annoying here, we have:
https://github.com/prisma/prisma/blob/8659f92d08d39470565db36f8b29a82bac8cec5e/packages/cli/src/Generate.ts#L159
with this error
https://github.com/prisma/prisma/blob/8659f92d08d39470565db36f8b29a82bac8cec5e/packages/internals/src/utils/tryLoadEnvs.ts#L139
so this test no longer works
| .replace("UpdateMany", "") | ||
| .replace("AndReturnOutputType", ""), | ||
| ); | ||
| return `UpdateManyAndReturn${modelTypeName}`; |
| createOneUser(data: UserCreateInput): User! | ||
| deleteManyPost(where: PostWhereInput): AffectedRowsOutput! | ||
| deleteManyUser(where: UserWhereInput): AffectedRowsOutput! | ||
| deleteManyPost(limit: Int, where: PostWhereInput): AffectedRowsOutput! |
| updateManyUser(data: UserUpdateManyMutationInput!, where: UserWhereInput): AffectedRowsOutput! | ||
| updateManyAndReturnPost(data: PostUpdateManyMutationInput!, limit: Int, where: PostWhereInput): [UpdateManyAndReturnPost!]! | ||
| updateManyAndReturnUser(data: UserUpdateManyMutationInput!, limit: Int, where: UserWhereInput): [UpdateManyAndReturnUser!]! | ||
| updateManyPost(data: PostUpdateManyMutationInput!, limit: Int, where: PostWhereInput): AffectedRowsOutput! |
|
@MichalLytek Please take a look! |
|
Thks for this merge, Just i ve some issue using enum directly in the schema, the compilation get some error because enum is defined in prisma 6 and in generated code.. and add manually registerEnumType(roles, { in my main file entrypoint My main raison is i use this code: I cannot use graphql here with my context and also because i use Partial from typescript, so any reference to roles find duplicated with generated code. i just write my changes here if anyone see the problem |
This PR updates the DMMF generation to support DMMF outputted from Prisma 6.19. It also adds supports for the new clients and aliasing Prisma introduced since ver 5.
I use this project as part of Hack the North, a student run hackathon, and our backend is coupled extremely tightly to this framework and GQL as a whole. We've been on Prisma 5 for a while and would like to move to Prisma 6, which is why I am sending this patch.
I spent a decent amount of time reading DMMF and this repo to familarize myself with the general structure/logic behind generation, so I could police my coding agent when I was using it.
AI Usage:
This final PR was constructed with the help of agents, with careful and thoughtful human supervision.
My approach was to find the 2 commits where Prisma 5 left off, then find out where 6.19 was. For each of the commits, I asked the agent to collect the changes in the DMMF, and write it to a SQL db with the commit hash. I then had another coding agent go over each of those hashes and scan this repo for areas where it could apply changes.
I then confirmed the changes myself by hand in the main Prisma repo by looking at the PRs. I looked for tests to add where I felt appropriate, and instructed the agent to add them.
I did not update experiments or examples.