Use case:
I have a group of development projects that I want to showcase, and under each one I want to have logos of the languages/technologies used in them
Structure:
project: {
technologies: [
// content relationship to "technology" type
]
}
technology: {
name,
string
}
Sample data:
// projects
[
{
name: "My website",
technologies: [
"ruby_on_rails",
"vue"
]
},
// .....
]
// technologies
[
{
id: "ruby_on_rails"
name: "Ruby on Rails",
logo: "/rails_logo.jpg"
},
{
id: "vue",
name: "Vue",
logo: "/vue_logo.jpg"
}
//....
]
But when I query the API...
let prismicResponse = await $prismic.api.query(
$prismic.predicates.at('document.type', 'project'),
{lang: '*', fetchLinks: 'technologies'}
)
it seems that only the reference to the document is returned, and not the document itself
technologies: [
{
technology: {
id: 'X8punhAAACMAKTOU',
type: 'technology',
tags: [],
lang: 'en-gb',
slug: 'vue',
first_publication_date: '2022-11-09T14:10:08+0000',
last_publication_date: '2022-11-09T14:10:08+0000',
link_type: 'Document',
isBroken: false
}
},
How should I change my structure and/or query to achieve the desired outcome?