T
TanStack3y ago
wise-white

Access data from a query on component level

Hey, I am using react query and the graphql-client in next to fetch data from contentful. All pages are defined in contentful. Every page has a pageType. On page level [[...slug]] I fetch all the pages via getStaticProps. So now I have all the pages available. My question is how can I access the pageType of a page on component level? Can I find the data of the page in some kind of context? Or do I have to create a react context for the client side to make it available in my components?
1 Reply
wise-white
wise-whiteOP3y ago
when thinking about it I would probably write another query to get the pageType by pageId but I still have to get the pageId in my component?!

Did you find this page helpful?