2

When trying to access the children of the different templates at the same level. We will be getting this error

Fields "children" conflict because they have different arguments. Use different aliases on the fields to fetch both if this was intentional.

enter image description here

Query=> children(includeTemplateIDs: ["{GUID}"]) {
    ... on Icon {
      name
      image {
        alt
        src
      }
      linkUrl {
        anchor
        linkType
        target
        url
        className
      }
    }
  }
children(includeTemplateIDs: ["{GUID}"]) 
  {
    ... on Menu {
      name
      linkUrl {
        anchor
        linkType
        target
        url
        className
      }
    }
  }
}
1

In this case, we should aliases text to children at the same level and this applies to all the fields, items. Here in this example SocialIcon and MenuList as aliases.

 { SocialIcon: children(includeTemplateIDs: ["{GUID}"]) {
    ... on Icon {
      name
      image {
        alt
        src
      }
      linkUrl {
        anchor
        linkType
        target
        url
        className
      }
    }
  }
 MenuList:  children(includeTemplateIDs: ["{GUID}"]) 
  {
    ... on Menu {
      name
      linkUrl {
        anchor
        linkType
        target
        url
        className
      }
    }
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.