-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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] refactor node structure to hide internal fields #960
Conversation
Deploy preview ready! Built with commit 9c86a7c |
Deploy preview ready! Built with commit 9c86a7c |
Deploy preview ready! Built with commit 9c86a7c |
type: Joi.string().required(), | ||
pluginName: Joi.string().required(), | ||
content: Joi.string(), | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's added automatically by api-runner-node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not required according to this validation, shouldn't contentDigest
then not be required too? Or are those not added in the same way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jquense to expand on my answer I typed on my phone as my plane took off :-) If we know which plugin created every node we can do optimizations eventually like invalidating only nodes created by a plugin when it updates, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0x80 what's "it" here?
domain, | ||
order: i + 1, | ||
parent: `__SOURCE__`, | ||
type: `HNStory`, | ||
children: [...kids.kids.map(k => k.id)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of the PR but I just happened to notice the redundant [...]
here. It could just be children: kids.kids.map(k => k.id),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good point :-)
@@ -133,11 +135,13 @@ fragment commentsFragment on HackerNewsItem { | |||
} | |||
let commentNode = { | |||
..._.omit(comment, `kids`), | |||
order: i + 1, | |||
type: `HNComment`, | |||
parent, | |||
children: [...comment.kids.map(k => k.id)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here
* Ignore SVGs in gatsby-remark-responsive-image …and instead just copy them alongside GIFs in gatsby-remark-copy-linked-files. * Fix reference to node `contentDigest` @see #960 @see https://github.com/gatsbyjs/gatsby/releases/tag/v1.0.0-alpha15 * Check node extension instead of sliced image.url
* Initial refactor done * Remove unused code * Some fixes * Bump site version number cause it's getting better and stuff * Fix source-drupal plugin * Add basic documentation for node interface and hacker news source plugin
No description provided.