throw new PrismaClientKnownRequestError(message, e.code, this.client.\_clientVersion, e.meta);
PrismaClientKnownRequestError:
Invalid `prisma.models.findMany()` invocation in
export const getAllModels = async () => {const resUnparsed = await prisma.models.findMany(
Error converting field "campaign_id" of expected non-nullable type "String", found incompatible value of "9156".
at Object.request (/home/shay/nbo-mvp/backend/node_modules/@prisma/client/insait/runtime/index.js:45405:15)
at async PrismaClient.\_request (/home/shay/nbo-mvp/backend/node_modules/@prisma/client/insait/runtime/index.js:46301:18) {
code: 'P2032',
clientVersion: '3.14.0',
meta: { field: 'campaign_id', expected_type: 'String', found: '9156' }
im not sure how to approach it since prisma documentation does not have this error code
It looks like your field campaign_id
field is stored as an integer in the database, while you specified a String
in your prisma.schema
. You can check that by making a query directly in the db (e.g. in Postgresql):
select pg_typeof( campaign_id ) from your_table;
You might need to migrate first:
npx run prisma migrate dev
Which will tell you in case of desynchronization