Adding `isFrontPage` boolean to Pages data
zgordon opened this issue · 5 comments
It would be helpful to know if a page is assigned as the static homepage from WordPress. If we could expose this then we could tell when calling createPage() when to reassign the URI from the slug in WordPress to /
so it loads as the homepage in Gatsby automatically as well.
Hey @zgordon did you manage to get this working? Would love to see an example, struggling to get this working myself with a custom blog / home page setup on WP
Haven't had a chance to make any updates to this in a while as we're focused on our new premium themes coming out, but how to do this is covered in my Headless WordPress Course with Gatsby over at javascriptforwp.com :)
@samuelgoddard this issue was actually intended to be opened on the WPGraphQL repo, and @zgordon did open it there: wp-graphql/wp-graphql#1028
You can now query the isFrontPage
field on Pages in the WPGraphQL Schema, but there's not an example of that implemented in Gatsby that I can point you too right now.
You can check out the tests added in the PR here for ideas on usage:
https://github.com/wp-graphql/wp-graphql/pull/1031/files
Here is an example for those looking :)
Thank you very much @zgordon @jasonbahl, exactly what I was after. Keep up the great work! :)