Query returns nothing for embedded-asset-block type nodes.
See original GitHub issueHello, team. I have an ApolloClient with the uri of https://graphql.contentful.com/content/v1/spaces/${SPACE}/environments/master?access_token=${TOKEN}
to make queries using the useQuery
hooks from @apollo/client
.
Unfortunately, when I have a query that expects an embedded-asset-block
, I don’t get anything in return. I have a rich body that has some embedded assets like images and videos. The textual data (h1, p) - those are returning fine but the embedded types return nothing. I need the embedded types because I am using documentToReactComponents
from @contentful/rich-text-react-renderer
to render the rich body in its entirety.
Here is the query:
{
newsEntryCollection(where: {slug: $slug}) {
items {
body {
json
}
imagesCollection {
items {
url
contentType
}
}
}
}
}
Returns
{
"data": {
"newsEntryCollection": {
"items": [
{
"body": {
"json": {
"nodeType": "document",
"data": {},
"content": [
{
"nodeType": "paragraph",
"content": [
{
"nodeType": "text",
"value": "We’re living through so much these days, that at times it feels like attending to our basic needs is plenty. And while that means being gentle with ourselves, it doesn’t mean we have to give up on our ‘best selves’ entirely. But instead of forcing your way through another push-up competition or zoom book club, it’s nice to remember that sometimes doing less really is more.",
"marks": [],
"data": {}
}
],
"data": {}
},
{
"nodeType": "embedded-asset-block",
"content": [],
"data": {
"target": {
"sys": {
"id": "1naXSnyhKwtvVIGk2GGzer",
"type": "Link",
"linkType": "Asset"
}
}
}
},
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:6
Top Results From Across the Web
gatsby-source-contentful BLOCKS.EMBEDDED_ASSET data ...
below my "cut" Graphql, and yes I can console.log image data from references. div4 : contentfulRepeater(name: {eq: "div4"}) ...
Read more >Rendering linked assets and entries in the Rich Text field
Let's return to the example Rich Text field with two embedded links — a code block entry and a video embed entry —...
Read more >tsm configuration set Options - Tableau Help
Use this option to adjust the maximum number of embedded external assets ... Catalog can return before the node limit is exceeded and...
Read more >How To Use The Contentful Rich Text Field with Gatsby
There are two types of nodes available on richText , the first is called raw ... This GraphQL query will return a large...
Read more >Query Cheat Sheet - GROQ - Sanity.io
Data query examples. ... *[_type == "movie"][0] // a single movie (an object is returned, not an array) *[_type == "movie"][0..5] // first...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
#119 has no answer whatsoever. This remains unsolved.
Have same issue. embedded-asset and embedded-entry have no content.