This repository was archived by the owner on Jul 28, 2025. It is now read-only.
Replies: 1 comment
-
I believe what you want is // find a post
post, err := client.Post.FindFirst(
db.Post.Title.Equals("hi"),
).With(
// also fetch 3 of its comments
db.Post.Comments.Fetch().Take(3),
).Exec(ctx)
check(err)
log.Printf("post's title: %s", post.Title)
comments := post.Comments()
for _, comment := range comments {
log.Printf("comment: %+v", comment)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have example schema:
and I would like to fetch all Posts with all Comments in single query.
There is a documentation about some, every, none https://goprisma.org/docs/walkthrough/find#querying-for-relations but I would like to select all without any special condition.
Beta Was this translation helpful? Give feedback.
All reactions