Hi. ```'Error: \nInvalid `prisma.todo.create()` i...
# orm-help
i
Hi.
Copy code
'Error: \nInvalid `prisma.todo.create()` invocation:\n\n\n  Null constraint violation on the fields: ()\n    at RequestHandler.handleRequestError
1
r
Hi @Industrial - just checking but have you done a
prisma migrate
or
prisma db push
?
i
Hi @Richard Ward, yes the db is in sync.
This is the SQL query:
Copy code
INSERT INTO "public"."Todo" ("id","label","completed","createdAt","updatedAt","listId") VALUES ($1,$2,$3,$4,$5,$6) RETURNING "public"."Todo"."id"
Unfortunately, I can't see the values used in the query from the log. That would be a nice addition to the prisma logger 🙂 then I could copy it into a SQL client and run the query
and/or the log/error returned back from the DB would be interesting to see
creating a
List
object works fine:
Copy code
INSERT INTO "public"."List" ("id","label","createdAt","updatedAt") VALUES ($1,$2,$3,$4) RETURNING "public"."List"."id"
where data is just
Copy code
{
  label: "asdfasdfsadf",
}
For the Todo the data is
Copy code
{
  label: "asdfasdf",
  list: {
    connect: {
      id: "cl53un75d0060s6lvtxvq1is2",
    },
  },
  project: {
  },
}
@Richard Ward sorry if this is a flood of information, just trying to give you as much context as possible 😄
When I open Prisma Studio then I can add
List
,
Project
,
Tag
but not
Todo
. I have one non optional column
label
in there and when I fill it in the green
Save 1 change
button is greyed out. Definitely something going on here 😄
Oh. There's no horizontal scroll bar.
Fixed the problem. the
projectId
and
project
properties were not optional. I was expecting them to be.
🙌 1
r
sorry - I was just catching up but glad you found the issue @Industrial 🙂