Wordpress non-primary menu not appearing in GraphQL

Viewed 52

I am trying to insert a non-primary menu into my Gatsby site using GraphQL. I am following this documentation here

I created a menu called 'Steve-Menu' I have registered the menu in functions.php like so:

add_action('after_setup_theme', 'register_gcd_menu');
function register_gcd_menu() {
    register_nav_menu('Steve-Menu', 'Geo Code Design');
}

In my admin the new location "Geo Code Design" is available. I check the box to assign it a location. Should be active, right?

I use the following GraphQL query in GraphiQL

{
  wpMenu(locations: {ne: PRIMARY}) {
    menuItems {
      nodes {
        id
        title
        uri
      }
    }
    locations
  }
}

I get null. I was expecting to see the other menu. I think the problem is that the location isn't appearing as an enum. The only location listed in the GraphiQL autofill is the enum PRIMARY. Is this a problem?

0 Answers
Related