Hi all: question, I'm trying the exists function i...
# orm-help
m
Hi all: question, I'm trying the exists function in Go as mentioned here: https://www.prisma.io/docs/prisma-client/features/check-existence-GO-go01/ I'm relatively new to Go and Prisma, how would i call this in the following situation:
Copy code
func (r *mutationResolver) CreateDraft(ctx context.Context, title string, userId string) (*<http://prisma.Post|prisma.Post>, error) {
	userExists := r.Prisma.Client.Exists.User(&prisma.UserWhereUniqueInput{
		ID: userId,
	})

	if(userExists == nil) {
		panic("User not found");
	}

	return r.Prisma.CreatePost(prisma.PostCreateInput{
		Title: title,
		Author: &prisma.UserCreateOneWithoutPostsInput{
			Connect: &prisma.UserWhereUniqueInput{ID: &userId},
		},
	}).Exec(ctx)
}