question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Query returns nothing for embedded-asset-block type nodes.

See original GitHub issue

Hello, 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:open
  • Created 3 years ago
  • Reactions:8
  • Comments:6

github_iconTop GitHub Comments

3reactions
angelod1ascommented, Nov 27, 2020

#119 has no answer whatsoever. This remains unsolved.

2reactions
Kyoss79commented, Feb 24, 2021

Have same issue. embedded-asset and embedded-entry have no content.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found