GraphQL with Strapi 4: How to query all components as unstructured JSON? #38934
Unanswered
paulwellnerbou
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are migrating our CMS from Strapi 3 to Strapi 4, adjusting our GraphQL queries.
We have some dynamic zones (e.g. Components), which we just want to query as unstructured JSON. So we defined this in our schema in
gatsby-node.js
:So we could just mention this field in our query, without adding any subfields:
This does not work with Strapi 4 any more. I would have to do something like this in the query:
Which I definitely do not want, as I don't want to adjust the queries each time I change the data model in Strapi.
And even then, how do I query lists/relations that are part of this component?
Is there a way to just say "Give me all components as JSON", as before?
I already considered dropping GraphQL completely, but I do not want to loose the preview feature. So unfortunately I have to use GraphQL.
Beta Was this translation helpful? Give feedback.
All reactions