Closed eduoliveira85 closed 4 years ago
Hi @edueter , it appears to be an authentication problem or a permissions issue for your WordPress.com instance.
If you look at the response from the REST api for posts https://public-api.wordpress.com/wp/v2/sites/corpusfisioterapiapilates.wordpress.com/posts?page=3
You can see in the first post (110), the featured media item is for an item with the id 111.
If we attempt to access that media item directly it requires authentication https://public-api.wordpress.com/wp/v2/sites/corpusfisioterapiapilates.wordpress.com/media/111
And further the same is true for listing all media items in WP. https://public-api.wordpress.com/wp/v2/sites/corpusfisioterapiapilates.wordpress.com/media
I believe it will work if these are public (they should be public).
One thing you should be aware of is that we're working on a full rewrite of gatsby-source-wordpress
to use WPGraphQL instead of the REST api. This is for a variety of reasons but it means that soon using wordpress.com with Gatsby wont be supported (the current version of gatsby-source-wordpress will be deprecated).
Perhaps one day WPGraphQL will be supported on wordpress.com, but for now it's not possible to use it this way.
You can find more info about it here https://github.com/gatsbyjs/gatsby/issues/19292
If you're interested in trying it, there's currently an alpha for the new integration at https://github.com/gatsbyjs/gatsby-source-wordpress-experimental
I believe it will work if these are public (they should be public). Yes, they should. Not sure why it is like this.
However, based on what you said after, maybe I should get an instance of WP installed somewhere so I could take advantage of the new features of V4.
You can find more info about it here #19292 Thanks for this link and your comment on this case.
I'm going to close this since there's no purpose anymore.
Hey, while sourcing from a wordpress.com blog where all posts have a featured image, there's no such field within my query to pull. I have gatsby-transformer-sharp and gatsby-plugin-sharp installed. This is a sample of a node from allWordpressPost in my graphql:
I'd like to fetch those images to be able to process them thru gatsby-transform-sharp and I red it is possible, but can't figure out why it isn't working.
gatsby-config.js
This is the repo. Can anyone kindly take a look at it and tell me if I'm doing it wrong? Thanks in advance!