You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to set up a gatsby-strapi project and have been struggling to query deep nested data using graphql and gatsby's data layer. I am unable to populate data when a dynamic zone has components with images or sub components.
I am using Strapi V4 and Gatsby v5
Example: In strapi i have a single type for a webpage with a dynamic zone.
Inside the dynamic zone i have 2 components to choose from
a text link
an image link
Both components are made up of sub components for a basic link (label, href, isExternalLink) and a basic image (media, altText).
When i add content in Strapi CMS and run Gatsby Develop, I can query all data except for components inside the dynamic zone. Specifically, nested components and images inside a dynamic zone component. i only get strapi-component and id nodes...
I have defined all deep queries in my gatsby-config that gatsby needs to populate from strapi: doc notes here.
I have checked the max query depth in my strapi app beyond the default 7 layers. In Strapi's graphql playgound i am able to produce the data i need:
Does anyone know what the exact issue is and how best to solve this? i have read on some quirks using dynamic zones and sub components with gatsby-strapi-source plugin and Gatsby's data layer but have found nothing to resolve this. I am fairly new to the CMS and GraphQL realm - any help is appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there folks,
I have been trying to set up a gatsby-strapi project and have been struggling to query deep nested data using graphql and gatsby's data layer. I am unable to populate data when a dynamic zone has components with images or sub components.
I am using Strapi V4 and Gatsby v5
Example: In strapi i have a single type for a webpage with a dynamic zone.
Inside the dynamic zone i have 2 components to choose from
Both components are made up of sub components for a basic link (label, href, isExternalLink) and a basic image (media, altText).
![image](https://private-user-images.githubusercontent.com/98284615/339414544-dab6dc5f-f350-4bc8-8da9-8cc85caa5a44.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNzQxMzYsIm5iZiI6MTcyMDI3MzgzNiwicGF0aCI6Ii85ODI4NDYxNS8zMzk0MTQ1NDQtZGFiNmRjNWYtZjM1MC00YmM4LThkYTktOGNjODVjYWE1YTQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA2VDEzNTAzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY4NDI3N2NmYmQxOTNiMzk5MjgxMDRhMjIxNDk5OWQ1ODBjYWYwM2VjNzhhNzMxMGY2NDU0ZmNlZDFiM2EzMWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hH2rufWLCf4vXffcJaLgf5QWQdBxXPY7IOY86UYpN7A)
When i add content in Strapi CMS and run Gatsby Develop, I can query all data except for components inside the dynamic zone. Specifically, nested components and images inside a dynamic zone component. i only get
strapi-component
andid
nodes...I have defined all deep queries in my gatsby-config that gatsby needs to populate from strapi: doc notes here.
I have checked the max query depth in my strapi app beyond the default 7 layers. In Strapi's graphql playgound i am able to produce the data i need:
Does anyone know what the exact issue is and how best to solve this? i have read on some quirks using dynamic zones and sub components with gatsby-strapi-source plugin and Gatsby's data layer but have found nothing to resolve this. I am fairly new to the CMS and GraphQL realm - any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions