agentejo / CockpitQL

GraphQL addon for Cockpit CMS - https://github.com/agentejo/cockpit
70 stars 7 forks source link

Linked item does not work #11

Open joshuaavalon opened 5 years ago

joshuaavalon commented 5 years ago
{
  allPerson {
    name
    image {
      url
    }
  }
}

It returns url as null. It seems like linked items only return _id

aequi42 commented 5 years ago

Had a similar Problem. Looking through the closed issues, I sumbled across this reply It suggest to set the populate parameter:

query { 
   allCategories(populate:1) {
       _id, 
      Subcategories { 
         Name 
      } 
   } 
}

and it's working!

wuhhh commented 5 years ago

Also worth knowing - if you have deeper levels of nested linked collections, you can just increase the populate integer as necessary.