gatsbyjs / wp-gatsby

WordPress plugin for gatsby-source-wordpress
Other
167 stars 41 forks source link

WPGatsby prevents WPGraphQL filter from making menus with no location public #139

Open sarahannnicholson opened 3 years ago

sarahannnicholson commented 3 years ago

I've been trying to migrate from gatsby-source-wordpress v3 to gatsby-source-wordpress-experimental for a while now. And having a little trouble with the menus.

WPGraphQL shows how to make menus without location public in PHP

When I add this code into WordPress I can see all 4 of my menus in the GraphiQL. But when I run Gatsby it still requires a menu location. I guess I am wondering, if WordPress is providing these menus should Gatsby respect that? Cause right now it's not.

https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/blob/18a3b2b82129756e7f02f34c9e17811dfcc3f3dc/plugin/src/models/gatsby-api.ts#L268

I am assuming there's some location filtering for menus because when I take the query gatsby wrote to a file and run it in my WordPress GraphiQL I get 4 menus, but on gatsby develop the build reports 1 menu retrieved.

Maybe this issue can be more of a question / conversation cause I'd love to understand this more.

Resources: https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/issues/41 https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/issues/36 https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/blob/master/docs/using-data.md

chawax commented 3 years ago

I had this problem too. And I use some menus to group some posts, pages and other things. So I don't need a location for these ones.

acao commented 3 years ago

is it possible someone can share a repo with steps to reproduce this bug consistently? last month I tried hard to reproduce it more than once.

so, I'm guessing gatsby clean and a fresh build fixes the issue temporarily, and the locations show up as expected then? or is that not even happening?

acao commented 3 years ago

also, for anyone who has this issue, can you please provide the versions you're running?

chawax commented 3 years ago

I have this issue with :

TylerBarnes commented 3 years ago

It appears the snippet at that wpgraphql.com link doesn't actually work 😱 and the culprit is WPGatsby - somehow it's overriding that snippet. Transferring this to the WPGatsby repo and adding it to our internal backlog

cavemon commented 3 years ago

It appears this issue still exists. I feel like querying menus without a location should be standard?