All other slices using GraphQuery

Hello there!

Looking for another help:

Using the GraphQuery to query the Slices with relationship, for example:

page {
  ...pageFields
  body {
    ...on someSlice {
        non-repeat {
          ...non-repeatFields
        }
    } 
  }
}

But now I'm only getting the someSlice slice. How can I query all the others?
Should I continue to specify one by one? ...on anotherSlice
Is there any option to query all the rest?

Hello @deki

Thanks for reaching out to us.

Are you trying to fetch the slice content with the Content relationship filed? In that case, you need to specify the Content Relationship field in your GraphQuery. Here is the documentation for this .

page {
  ...pageFields
  body {
    ...on someSlice {
        non-repeat {
          ...non-repeatFields
          content_relationship_field_name {
           ... on type_of_linked_doc {
             ...linked_doc_type_Fields
          }
        }
     } 
   }
}

Give this a try and let me know.

Thanks,

Priyanka

Thanks a lot @Priyanka! All of our nested relationships are working now.

But like in this example above, now I'm getting only the "someSlice" slice.
How do I get all the rest slices? Should I specify one by one?

Hello Hideki, yes, you need to specify each slice to get the content.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.