[1.0] Best way to check if a relation exists between Users


#1

Example: you want to check if you are already following a specific user. This would determine whether you show the Follow or Unfollow button.

What is the best way to query for this information using ctx.db.exists?

EDIT: It seems that you must use ctx.db.exists.User instead of ctx.db.exists.user – this was my issue.


#2

Yep, prisma-binding has an exist method :slight_smile: Marking your question as solved :+1:.