pristas-peter / wp-graphql-gutenberg

Query gutenberg blocks with wp-graphql
https://wp-graphql-gutenberg.netlify.app
GNU General Public License v3.0
299 stars 61 forks source link

Querying core image block - missing dimensions fields #147

Open eliawk opened 2 years ago

eliawk commented 2 years ago

Hello, when I query the image block like this:

... on CoreImageBlock {
      attributes {
        ... on CoreImageBlockAttributes {
          url
          width
          height
          className
          sizeSlug
          caption
        }
      }
    }

I can't get dimensions fields (width and height) as you see form the screenshot:

Schermata 2022-05-16 alle 17 48 19

could you please help me fix this?

sahandnayebaziz commented 2 years ago

I am also seeing an issue where core/image is returning the wrong URL (it's still showing my WP url, where it should be showing an S3 url since I use offload-media and all of the WP UI shows me the media urls with the S3 prefix).

Could these be related? Maybe the metadata of images isn't being forwarded totally correctly?

brianpereradap commented 2 years ago

I'm also having the same issue. Any luck finding a workaround?

theianjones commented 1 year ago

@eliawk you have to edit the dimensions in the editor to get this to work. I created a new block that got the naturalHeight and naturalWidth from the image. Its odd that the core block doesnt have this be default.