i'm a beginner can someone tell me why i'm getting...
# orm-help
d
i'm a beginner can someone tell me why i'm getting this error "null constraint violation on the fields "
k
you should pass in the author as well. something like this:
Copy code
author: {
connect: {
id: value
}
}
on a second thought, the author is optional in your schema
d
thank you for the help it's worked
🙌 1
r
author
is optional but the
authorId
isn’t. That’s what’s causing the violation. You need to make both of them optional.
👍 1