next-drupal: Not able to access paragraphs data
Hi, first and foremost, thanks for a great integration with Drupal!
We’re trying this out and we’re running into issues when trying to populate paragraphs data to our basic pages.
In [...slug].tsx
we’re including field_content
which holds all our paragraphs:
if (type === "node--page") {
params = {
include: "field_content",
}
}
When we console.log our response
(the entire node data) we can see that there is a paragraph called paragraph--hero
which is good. But we can’t access the data nested inside the paragraph:
When we check our api-response locally (http://localhost/jsonapi/node/page?include=field_content
), we can see that our nested paragraph data lives inside the included
part of the response:
Sadly the included
part is not available to us when we console log the entire node data:
Does anyone have a solution or know how to access the nested data? We need this to be able to build dynamic pages.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15
Hi again @shadcn!
I continued to investigate this yesterday and it seems like I hadn’t configured the module
Paragraphs Type Permissions
properly.After I configured that anonymous users would be able to view my Hero paragraph, the data is now showing up in my response.
Thanks for all your help and feedback!