Skip to content

Add wordpress_parent_id to nodes with parents #20

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

Merged
merged 1 commit into from
Nov 11, 2019

Conversation

shendriksza
Copy link

When generating some WooCommerce nodes (eg. product categories), a "parent" field is used for the wordpress parent category id. In this case, the parent field will be overridden by the GraphQL parent node.

This solves that issue, and when the node.parent is "undefined", wordpress_parent_id field is not generated

@pasdo501 pasdo501 merged commit de5d0f4 into pasdo501:master Nov 11, 2019
@pasdo501
Copy link
Owner

Thanks for that! I've gone ahead and extended your addition some more - nodes now also have wordpress_parent & wordpress_children fields, which are links to the nodes themselves, to make it easier to grab extra data when you want more than just the ID :)

@shendriksza
Copy link
Author

Excellent work, thank you so much! Sorry I was in a bit of a rush when I made the pull request and did not consider if it could be improved

@pasdo501
Copy link
Owner

No problem at all, thank you for spotting & fixing the issue in the first place!

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.

2 participants