Getting multiple fields from an reference field

For the most parts of our data we have a parent -> child relation. Where we select the parent at the entity of the child.

For links and breadcrums on the child page we also need some information for the parent. But that is only the name and the slug. Now when we get the details of the child, then we get the ID of the parent. We need to do an extra call to get the small information that we need of the parent.

Is there something in Squidex so that we can use something like sub-selection as is described in https://graphql.org/learn/queries/ so that we can minimize the amount of calls to get the full data.

Have you tested out the graphql endpoint in Squidex?

No, but i found the graphql now under API’s. Will test it there.

If you go to the API section you can try it out with GraphiQL directly.

if you have a reference to the parent you can do something like this

queryChildContents {
   id
   data {
      name {
        iv
      }
      parents {
        iv {
          id
          data {
            name {
               iv
          }
        }
     }
  }
}

Thank you for the example. This works!

1 Like