New GraphQL node (ChildImageSharp
) from another node that may or may not be an image url string
#30814
Unanswered
dungle-scrubs
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Gatsby v3 with
gatsby-source-shopify
and have exposed some metafields. Currently those metafield are queried through GraphQL like this:The above works great and I can access the metafields. However, if one is a string containing an image url, I can't run it through
ChildImageSharp
from the frontend.The
value
field can contain a string, number, or boolean. What I'm trying to achieve is, when it's a string and also an image url, I'd like to either create a new GraphQL node (or extend the current one?) to be able to query the image usingChildImageSharp
. In my mind, the structure would look like this:The direction I'm heading isn't working and I'm not sure how to approach it, but this is what I'm thinking so far:
I'm stuck at this point. Am I taking the wrong approach?
Beta Was this translation helpful? Give feedback.
All reactions