Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0] Make nodes fully immutable by adding API for allowing plugins to add fields #1035

Merged
merged 17 commits into from
May 26, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify error message
  • Loading branch information
KyleAMathews committed May 25, 2017
commit 8f77c1acc681b617932238a5595ef6d0264ff96f
11 changes: 2 additions & 9 deletions packages/gatsby/src/redux/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,10 @@ actions.createNode = (node, plugin) => {
if (oldNode && oldNode.internal.pluginOwner !== plugin.name) {
throw new Error(
stripIndent`
Nodes can only be updated by their owner. Node ${node.id} is
owned by ${oldNode.internal.pluginOwner} and another plugin ${plugin.name}
Nodes can only be updated by their owner. Node "${node.id}" is
owned by "${oldNode.internal.pluginOwner}" and another plugin "${plugin.name}"
tried to update it.

Node:

${JSON.stringify(node, null, 4)}

Plugin that tried to update the node:

${JSON.stringify(plugin, null, 4)}
`
)
}
Expand Down