hey, quick question, can I make resolver while not...
# orm-help
t
hey, quick question, can I make resolver while not using graphql-yoga, just a generated prisma client?
h
@Tomasz I am not really sure what you mean by "resolver" outside the context of a graphql server. And yes, you can use prisma any nodejs application
t
ok sorry let me clarify, Im searching to way to fetch eg. all posts with included comments (defined as table relation). and using prisma client it is not possible as I understand, only calling graphql query with defined resolver to include comments in Post as it was described in doc "a-guide-to-common-resolver-patterns-ct08", but there is no description how to use it with prisma client
h
Try using the
.$fragment
syntax. example
Copy code
const postsWithComments = await prisma.posts().$fragment(`fragment EnsureComment on Post {
   comment{
     id
    # ....
   }
});
👍 1
t
ok
thanks, that works
🙌 1