Hi there! I'm loving Prismic so far but have hit a roadblock with the GraphQuery API when trying to retrieve the content from a content relationship field in the non-repeatable zone of a slice. Hoping someone can help – I'm using Next.js if that makes any difference, and have successfully used the GraphQuery flow elsewhere on the project, this is just a more complex query!
So, I have this query below which works fine, but does not seem to provide any further information (or data
) on the track
content type that I am trying to link to (in the slice also called track
). I had kind-of expected adding ...non-repeatFields
to add this in.
const projectGraphQuery = `{
project {
...projectFields
body {
...on track {
non-repeat {
...non-repeatFields
}
}
}
}
}`;
I've tried variations on the query, such as this one (below) – but I get 400 errors without much feedback.
const projectGraphQuery = `{
project {
...projectFields
body {
...on track {
non-repeat {
...non-repeatFields
track {
...trackFields
}
}
}
}
}
}`;
I am sure this is just a problem with my understanding of the API. The question seems similar to others on the forum, but I don't seem to be able to find answers on how to integrate this with the new GraphQuery API (this post answers with FetchLinks I think?) or specifically in the non-repeat
zone of a slice (I'm not sure if that makes a difference!).
Any help would be greatly appreciated