Longform content with GraphQL #216
Replies: 7 comments 3 replies
-
I think it's essential to have a headless frontend that can be as dynamic as possible |
Beta Was this translation helpful? Give feedback.
-
+1 stumbled upon this today and was a bit sad that GraphQL won't output text and blocks (nested entries) separated 😢 😉 But I guess this could be added in future? |
Beta Was this translation helpful? Give feedback.
-
Argh. I just hit this wall too. Being able to insert/embed entries within a CKEditor field is PERFECT, but we need to be able to iterate through these entries via GraphQL since we typically use Craft as a headless CMS. 😢 |
Beta Was this translation helpful? Give feedback.
-
I agree, it needs a way to get that data in a nice way via GQL. We are using craft also headless and creating twig templates for that partials is a way but then, I can't use my react comps to render that stuff. would be great to query that things like matrix blocks. |
Beta Was this translation helpful? Give feedback.
-
+1 for this! This is very disappointing. To make this work with a headless frontend (with SSR) right now requires the following steps:
I may be missing some steps, but the point is just to illustrate that the current situation is not really viable longterm for headless frontends. The only workaround I can think of is going back to the way I was doing it before, with a Neo or Matrix field and have a CKE editor field inside a |
Beta Was this translation helpful? Give feedback.
-
Good News by Brandon Kelly, it's on the radar 🎉
|
Beta Was this translation helpful? Give feedback.
-
Any news on this? It would be awesome to have that feature now. |
Beta Was this translation helpful? Give feedback.
-
What is the recommended way to use the new longform content with GraphQL? It feels wrong and cumbersome to create a file in the _partials folder, then retrieve the required content in twig, pass it to the frontend using GraphQL, only to parse it again for styled output.
The other solution, to output the styled data directly, goes against my understanding of using Craft CMS as a headless solution. This is because it has to be up to the frontend to decide what to do with the content. The same data could be displayed differently in the frontend in different cases. Not only the style but also the structure of the html can be different.
For a headless CMS, I think the output should be something like this.
Instead of
The question is how is it possible to split the editor content back into structured data and also how is it possible to request only the necessary data from GraphQL.
I'm probably just looking at this the wrong way and I am stuck in my thinking process. I would appreciate any input.
Beta Was this translation helpful? Give feedback.
All reactions