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

Fixes #1007, Add lowdb support #1038

Closed
wants to merge 2 commits into from
Closed

Fixes #1007, Add lowdb support #1038

wants to merge 2 commits into from

Conversation

gutenye
Copy link
Contributor

@gutenye gutenye commented May 25, 2017

I've a few questions and left notes in code.

Maybe we can extends builtin gatsby-transfomer-json with {"posts": [{"value": "a"}, ..]} support instead of a new package.

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit 0af5d71

https://deploy-preview-1038--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit 0af5d71

https://deploy-preview-1038--gatsbyjs.netlify.com

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit 0af5d71

https://deploy-preview-1038--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

I think putting this in its own package makes the most sense as there's an infinite number of ways JSON can be structured so trying to support those all in gatsby-transformer-json won't work.

Also with each transformer type being its own package, they'll be easy to find via Google or the Gatsby website.

Could you just add your questions here as a comment please.

@gutenye
Copy link
Contributor Author

gutenye commented May 27, 2017

@KyleAMathews
Okay, I'll create a new package.

What's children and parent used for in createNode()?
It seems works fine when I provide empty array for children and dummy id for parent.

@KyleAMathews
Copy link
Contributor

@gutenye they're useful conventions not a hard things-will-break-without-them requirement. They're there so that you can write queries following the transform chain. It's often useful for example to jump up from a transformed node to its file parent to get file specific information e.g. its size or file name, etc. I sometimes write queries too where I query for files and then jump to the right child.

So it's strongly encouraged you add them.

@gutenye
Copy link
Contributor Author

gutenye commented May 27, 2017

@gutenye gutenye closed this May 27, 2017
@KyleAMathews
Copy link
Contributor

Looking good!

FYI, there'll be some breaking changes for the API soonish see #858

Should be a pretty easy upgrade.

@gutenye
Copy link
Contributor Author

gutenye commented May 27, 2017

@KyleAMathews Thanks for the heads up.

@gutenye gutenye deleted the lowdb branch May 27, 2017 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants