Simple Custom Data API #36597
Unanswered
shalawfatah
asked this question in
Ideas / Feature Requests
Replies: 1 comment
-
This already exists: https://www.gatsbyjs.com/docs/reference/config-files/actions/#createNodeField https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/creating-a-source-plugin/#optimize-remote-images also shows how it's used to attach images to nodes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As of now, we can create data nodes through
sourceNode
andcreateNode
, but the process is too complicated. It would be nice if we had a simple hook to create custom data, or add a node to our already exisiting data nodes (image field for posts, etc). This is especially helpful for CMSs. One usecase I can think of is sometimes custom post types in Wordpress return image ID, instead of URL, which is not usable for Gatsby image optimization. If we had such a hook, we could easily create an image field out of the image ID, and merge it back into the parent node, so we can statically generate and optimize it.Beta Was this translation helpful? Give feedback.
All reactions