Skip to content

Commit

Permalink
fix(gatsby-source-contentful): use safe stringification for Rich Text…
Browse files Browse the repository at this point in the history
… fields (gatsbyjs#10228)

The "Beta" Rich Text field for contentful was breaking when trying to load data into GraphQL that has circular references.

Using a safe stringify method prevents it falling over and instead just prevents the referenced circular data from being available.
  • Loading branch information
cjpete authored and gpetrioli committed Jan 22, 2019
1 parent 7b90377 commit b9bfe95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby-source-contentful/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function prepareTextNode(node, key, text, createNodeId) {
}

function prepareStructuredTextNode(node, key, content, createNodeId) {
const str = JSON.stringify(content)
const str = stringify(content)
const structuredTextNode = {
...content,
id: createNodeId(`${node.id}${key}RichTextNode`),
Expand Down

0 comments on commit b9bfe95

Please sign in to comment.