thompsonsj / gatbsy-source-payload-cms

MIT License
5 stars 0 forks source link

Refactor to remove custom node keys:`gatsbyNodeType` and `gatsbyImageCdn` #34

Open thompsonsj opened 1 year ago

thompsonsj commented 1 year ago

The logic is a bit flawed/messy for passing collection/global options around.

The flow:

As a result, when the data comes back (using promises) to source-nodes, the data itself is unaware of the original query/collection options. We've gotten around this limitation by adding the gatsbyNodeType and gatsbyImageCdn fields to the node itself, but modifying the node feels obtuse.

Refactor the logic to make this process cleaner and easier to understand.