Closed robmarshall closed 5 years ago
Hi,
Yes, I expect that the uri is present in your graphql queries. Why wouldn't it be there? Uri is used as a key to cache parsed content and to avoid parsing it again when requested more than once. https://github.com/progital/gatsby-wpgraphql-inline-images/blob/6c360a75202e5f9bdff92a3f092e5290da42dcc2/gatsby-node.js#L31 Why would you not use uri?
Thanks for the quick reply.
It seems URI isn't showing up in the source. But it is in GraphQL. Not sure why!
Could it be that you have more than one query? For example, one query to get all posts and then another one in a post component to get post content.
Does your query include the URI? This may be the issue. Or should the resolver find this itself?
All your queries should include the URI.
Really? That would be the issue then! It's not mentioned in the readme, as far as I can see.
Could you check if adding the uri solves your issue? Not mentioning it was my oversight.
URI solves it. I was overlooking this section here: https://github.com/progital/gatsby-wpgraphql-inline-images/blob/6c360a75202e5f9bdff92a3f092e5290da42dcc2/gatsby-node.js#L49
So didn't understand the URI requirement. Only looked in the parser file.
Great stuff!
Hi,
I am using your plugin for my build, and am unable to swap images out using the contentParser. After tracing the issue back it seems that there is no URI key on the source object passed from WordPress: https://github.com/progital/gatsby-wpgraphql-inline-images/blob/6c360a75202e5f9bdff92a3f092e5290da42dcc2/gatsby-node.js#L23
This means all the content is returned without being run through the sourceParser.
What is the reason for checking for a URI? Where is this set in WordPress?
When I remove the URI checker, I end up getting errors from createRemoteFileNode within the utils.js file: https://github.com/progital/gatsby-wpgraphql-inline-images/blob/6c360a75202e5f9bdff92a3f092e5290da42dcc2/src/utils.js#L14
Error:
Any ideas what this could be?
Thanks