Skip to main content
1 of 2
Julius A
  • 752
  • 5
  • 19

Without a sample query reference to tailor my answer, I think what you could leverage here are query fragments to help with multiple templates.

For example:

fragment itemDetails on Item {
  id
  name
  children{
    children(includeTemplateIDs:"{GUID}"{
      id
      name
      someotherfield
    }
  }
}

You can then leverage the template on your query

query GetPageContent($datasource: String!, $contextItem: String!) {
  datasource(value: $datasource) {
    ...itemDetails
 }
 contextItem(value: $contextItem) {
    ...itemDetails
 }

Ps: Please validate this syntax, just guiding on the approach here

Julius A
  • 752
  • 5
  • 19