Prisma1: `@default` doesn't work in "create" part of upsert

Created on 12 Jan 2018  路  6Comments  路  Source: prisma/prisma1

Current behavior
If you use @default to add a default value to a field it works when you use create, but not when using upsert

Reproduction
Add @default to a field and try to create with upsert, leaving out the field

Expected behavior?
upsert should use default values

bu2-confirmed

Most helpful comment

Thanks for reporting this @ForsakenHarmony. I was able to reproduce and fix this. I will close this issue once the fix is rolled out.

All 6 comments

I'm not sure if I'd agree with the expected behaviour you propose. For now, the default value is only reflected in create mutations and I think that's how it should be.

Why should it not work in upsert?

Yea, i was thinking same. But only for create part of upsert

Ah, yea I agree 馃檪

Obviously just for the create part, doesn't make sense to reset to the default value everytime ig

Thanks for reporting this @ForsakenHarmony. I was able to reproduce and fix this. I will close this issue once the fix is rolled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorenbs picture sorenbs  路  3Comments

tbrannam picture tbrannam  路  3Comments

schickling picture schickling  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments

sedubois picture sedubois  路  3Comments