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

Error menu.js #21

Open
zakirsajib opened this issue Nov 18, 2019 · 3 comments
Open

Error menu.js #21

zakirsajib opened this issue Nov 18, 2019 · 3 comments

Comments

@zakirsajib
Copy link

@zakirsajib zakirsajib commented Nov 18, 2019

Menu not showing and generated error:

The GraphQL query from /Users/Sajib/tabor-gatsby-theme/packages/gatsby-theme-tabor/src/components/Menu.js failed.

Errors:
  Expected type MenuLocationEnum, found PRIMARY.
GraphQL request (3:5)
  2:   wpgraphql {
  3:     menuItems(where: {location: PRIMARY}) {
         ^
  4:       nodes {
  
Plugin:
  none
Query:
  query GET_MENU_ITEMS {
    wpgraphql {
      menuItems(where: {location: PRIMARY}) {
        nodes {
          ...MenuFields
          childItems {
            nodes {
              ...MenuFields
            }
          }
        }
      }
    }
  }
  
  fragment MenuFields on WPGraphQL_MenuItem {
    id
    label
    url
    connectedObject {
      __typename
    }
  }
@jasonbahl

This comment has been minimized.

Copy link
Collaborator

@jasonbahl jasonbahl commented Nov 18, 2019

@zakirsajib you'll need to change the location to a location that you have registered in your WordPress install.

This currently assumes you have a menu location called primary registered to your WordPress install and a menu assigned to it.

We should probably update this to use some setting in config to allow for you to define the value of the location of the menu you want to query, and only query for the menu if that is defined in the config 🤔

@zakirsajib

This comment has been minimized.

Copy link
Author

@zakirsajib zakirsajib commented Nov 19, 2019

Screen Shot 462

This is how it setup in wordpress. But still showing error.
But I can see the site with all posts but no menu shows up!

@i001962

This comment has been minimized.

Copy link

@i001962 i001962 commented Nov 25, 2019

@zakirsajib try changing the location from PRIMARY to MENU_1
That seems to have done the trick for me.
#12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.