<@U4LA03NLV> has Prisma stop casting String to Int...
# orm-help
f
@do4gr has Prisma stop casting String to Int values on mutations (and vice versa)? I was updating ‘123’ before to an Int field and was working fine but it suddenly started crashing 🤔
If this is the case I think it should be noted as breaking change. For example, I was getting data from Shopify API and turns out they provide
customerId
as INT but I was saving it as STRING. Worked well but it crashes now.
d
I am not sure what you mean. Can you describe the bug in more detail? With a datamodel and a mutation that fails if possible?
f
Copy code
type Order {
  customerId: String!
  postageFee: Int!
}
Copy code
db.mutation.createOrder({
  data: {
    customerId: 1111, // int
    postageFee: "2222" // string
  }
})
That was working well before in development but I just noticed it fails now. Since Prisma dev services are updated to beta versions automatically, I think that’s the only thing that changed in my environment. Does it makes sense?
(It still works in production since I didn’t update my Prisma service)
@do4gr any news? I just found the issue again
in 1.23.4
d
Hmm, I am not aware that we intentionally changed something along these lines. I’ll ask around
Which connector are you using?
f
Postgres
@do4gr I’ve seen this error today:
Expected type Int at value.quantity; Int cannot represent non-integer value: "1"
from Prisma. It’s a mutation from the front end where I was passing
"1"
instead of
1
. Working for months until I updated from 1.19 to 1.23
d
It seems like you are using Prisma Bindings. Did you also change that version? If so, from what version to what version?
f
@do4gr That’s true. I’ve checked my updates to that package and the most recent one seems to be from 2.2.8 to 2.2.14.