How do you add new nodes to existing gatsby-source-shopify nodes? #32947
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
-
I'm trying to add existing nodes to Shopify metafield nodes source from
gatsby-source-shopify
. Whenever the metafieldvalue
contains a publicly hosted image URL, I'd like to create a newlocalFile
node so the image can be processed usingGatsbyImage
.Additionally, the metafield value could be a string containing an image url, or it could be a stringified JSON array of multiple objects, some of which the
value
might be an image url (I use an app by Bonify called Custom Fields which allows you to create repeaters).Right now, I'm just focusing on metafield
value
s that are just a single image url string. Eventually, I'd like to add a node calledsubfields
that would query an array of key value pairs addinglocalFile
where values are image url strings.I need the nodes to have a specified
type
as well, so I can point an Imgix plugin at them. My first attempt was to usecreateNodeField
, but since it doesn't allow me to assign a nodetype
, there's not a way to target it with the Imgix plugin.This is what I'm eventually aiming for
This is where I'm at so far, but it just results in
null
values. I can't find any guides this specific and Gatsby's docs are a little out of my league when it comes to advanced GraphQL. Can someone point me to where I'm going wrong? Thanks in advance!Beta Was this translation helpful? Give feedback.
All reactions