Hi there, I'm getting this error `Argument id: Go...
# orm-help
a
Hi there, I'm getting this error
Argument id: Got invalid value 10 on prisma.updateOneUser. Provided Int, expected String.
when trying to update a entry an connect it's relation. Here you can find the schema and the update call. Am I doing something wrong?
r
@Alexander Braunreuther 👋 It seems you passing an
Int
to
userId
? If so, you would need to pass
10
as a String.
a
Hi Ryan, I'm passing 10 as organization id. Here is the input of the call:
Copy code
{
  "where": {
    "id": "79M4NDLgejkZSShtdJDuvD"
  },
  "data": {
    "organization": {
      "connect": {
        "id": 10
      }
    }
  }
}
r
I am unable to reproduce this by passing static values to the call. Could you run
prisma generate
and try again?
a
hmm you're right when passing static values it works. Seams there's something else. Thanks!
r
Yeah it seems the data coming from your input is mismatched.
a
Okay got it - maybe somebody else will get into the same problem: The client is created as a postinstall hook of the
@prisma/client
package. CI (I'm using firebase functions which use a build step internally) normally caches the node_modules - so it did with the firstly generated prisma client aswell. In my first aproach the organizationId was a string uuid. Now as the client on my computer is a new one with a Int based id it accepts it and the code looks alright, but the server has an outdated prisma client. So you need to make sure, that the client gets generated on every build.
r
In that case I would suggest adding
prisma generate
to the
postinstall
hook in your
package.json
so that it always runs.
125 Views