GraphQL equivalent Join Query amoung collections?

200 Views Asked by At

I am very new to Graphql. I have a basic question I want to write a GraphiQL query to fetch data among two collections I have a two collections one is Users and other one is Tasks.

Ideally in Sql the same would be written as follows…

SELECT * FROM Users INNER JOIN Tasks ON Users.id = Tasks.user_id

I tried writing in GraphiQl. I also tried adding filters also tried adding relationships. But I always am not able to retrieve the data.

{
     users {
                _id
                tasks {
                         _id
                      }
          }
}

My collections are as follows. Please let me know if any more info is needed from me?.. Appreciate your help.

enter image description here

0

There are 0 best solutions below