Hi, I have following two entities: Product id, desc, price, productgroupid ProductGroup id desc
As you can see, product entity has a reference id of product group (that is productgroupid). Now I have created a GraphQL that returns me the products. In this graphQL output I need the ProductGroup.desc and not the productgroupid. I mean I wanted to have joins. I already have two AppService (One for Product and one for ProductGroup created.
Can you please throw some hint on how to write joins in GraphQL. Would appreciate if you could provide some sample code...
Many Thanks, Mahendra
1 Answer(s)
-
0
Hi @mahendra
You can first include ProductGroup into your query as we did for User in this example;
After that, you can create a mapping to map
ProductGroup.desc
to your output DTO field here;