But I can't figure out how to show my content with the graphquery, also with showing just the project_name for example. If I remove the fetchlinks and keep with the {slice....} code, it gives me an error.
This is the response I get in my console, the data is being fetched:
GraphQuery is an API that allows deep fetching that you are already achieving, and that's great.
Now I believe you want to template the fields. If so, it's the same way templating with the fetchLinks.
In Next.js, here is a doc for templating fields in Slices: https://prismic.io/docs/template-content-nextjs#slices
to my slices/featuredProject/index.js but nothing is showing up there.
I'm familiar with templating in general, but with graphQuery, it looks like there a subtlety that I'm not understanding, is there something in particular to know?
It's the same with the "primary fields" of my project, which on [uid] are showed with {article.data.project_name}
and with fetch links, this works : {slice.primary.project.data.project_name}
but with graph, that code doesn't show anything and renders undefined...
Thank you, your answer helped me! I managed to make it work.
For other people looking for that answer, here is the set up in case they need:
I have a slicezone on my index page, which has a slice called "featured project".
In there I have a content relationship field, called "project".
<div className="project-information-container">
{slice.primary.project.data.project_name} <br/>
{slice.primary.project.data.project_client}
</div>
<div className="project-media-container">
<SliceZone slices={slice.primary.project.data.slices} components={components} />
</div>
```
And inside that slice called thumbnail, all is normal:
<PrismicNextImage
field={slice.primary.image}
className="object-cover"
fill
/>