Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue with generated GraphQL input CreateInput when using @default(uuid()) inside Prisma Schema #62

Closed
StephanDecker opened this issue Nov 11, 2022 · 1 comment
Assignees
Labels
is: bug Something isn't working package: generator Generator package

Comments

@StephanDecker
Copy link

Great work! We used the beta version and that worked smoothly. After updating to the RC it seems that ID fields that are auto-populated by the database are mandatory when executing the create* mutations. That means: When creating a record I have to handover the id although the id is autogenerated in the database:
Here is the example:

schema.prisma:

model Phase {
    id            String          @id @default(uuid())
    name          String          @unique
}
...?

generated schema.gql (using beta):

input PhaseCreateInput {
	name: String!
}

generated schema.gql (after upgrade to RC):

input PhaseCreateInput {
    id: String!
    name: String!
}

Could you fix that? Thanks!

@maoosi maoosi self-assigned this Nov 11, 2022
@maoosi maoosi added is: bug Something isn't working package: generator Generator package labels Nov 11, 2022
@maoosi maoosi changed the title ID fields that are auto-populated by the database are mandatory when executing the create* mutations Issue with generated GraphQL input CreateInput when using @default(uuid()) inside Prisma Schema Nov 14, 2022
@maoosi maoosi closed this as completed in bc7320d Nov 14, 2022
@maoosi
Copy link
Owner

maoosi commented Nov 14, 2022

Fix release in 1.0.0-rc.3.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
is: bug Something isn't working package: generator Generator package
Projects
None yet
Development

No branches or pull requests

2 participants