I’m facing a problem. When I create a post and try to connect the user id of the creator to that post, I get this error:
Here is the schema:
type Post {
title: String!
description: String
images: [Image!]
videos: [Video!]
type: String,
createdBy: User!,
likes: [User!],
comments: [Comment!]
}
Does the User
with this ID exist? That error message is saying you’re creating a new User
so you must provide all required fields of the user. Double-check the ID.
The system thinks the user with the ID you gave does not exist.
If the ID does not exist then it will try to create the User
. In this case, all required fields must be provided.