wpengine / wpengine/hwptoolkit

example: Querying menus for themes with no menu locations

Open
#88 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

topic:menus type:docs type:feat
Dominant language
PHP
Stars
47
Forks
3
Avg merge
1m
Merged PRs (30d)
19

Description

Background

If you try and query for any type of menu when building an example for some of the latest WP themes (e.g. Twenty Twenty Five) they don't have menu locations. See - https://www.wpgraphql.com/docs/menus

So the below query returns no menus

query Menu {
  menus {
    nodes {
      id
      databaseId
      name
      menuItems {
        edges {
          node {
            id
            label
            parentId
          }
        }
      }
    }
  }
}

We should look at adding examples on how a user can query menus for themes with no menu locations maybe through an example plugin in the example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the menus documentation at https://www.wpgraphql.com/docs/menus and the existing example query in this issue. Then inspect the repository's example area to determine how an example plugin can support themes without menu locations. Done means the examples demonstrate how to query menus for those themes and the documented query returns useful results.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.