I'm struggling a bit with the query for the model I set up. Essentially, I have a main page a tile and slices. There is only one slice type and that slice has a title, and then a group of fields that are all content relationships to other custom types I have created.
Can I setup a query with Gatsby so that the prismic user can keep adding slices with content relationships to different custom types without having to update the query every time they make a new custom type?
Here's an example. Say this Custom type is called Article and you have other two types of Custom types Page and BlogPost. This is how you'd cover the two other Custom Types inside the form_field link:
query MyQuery {
allPrismicArticle {
nodes {
data {
body {
... on PrismicArticleDataBodyTest {
id
items {
form_field {
document {
... on PrismicBlogPost {
id
}
... on PrismicPage {
id
}
}
}
}
}
}
}
}
}
}