WP Manifestindependent plugin directory
manifest / integrations / wp-graphql-tax-query

WPGraphQL Tax Query WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

Adds `tax_query` support to postObject connection queries using WP_Query

★ 55stars
v0.2.0latest · 3 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/wp-graphql/wp-graphql-tax-query/archive/refs/heads/develop.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

This plugin adds Tax_Query support to the WP GraphQL Plugin for postObject query args (WP_Query).

Pre-req's

Using this plugin requires having the WPGraphQL plugin installed and activated. (version 0.0.15 or newer)

Activating / Using

Activate the plugin like you would any other WordPress plugin.

Once the plugin is active, the taxQuery argument will be available to any post object connectionQuery (posts, pages, custom post types, etc).

Example Query

Below is an example Query using the taxQuery input on a posts query. (Go ahead and check things out in GraphiQL)

This will find posts that are in the category "graphql" OR tagged with "wordpress".

query{
  posts(
    where: {
      taxQuery: {
        relation: OR,
        taxArray: [
          {
            terms: ["graphql"],
            taxonomy: CATEGORY,
            operator: IN,
            field: SLUG
          },
          {
            terms: ["wordpress"],
            taxonomy: TAG,
            operator: IN,
            field: SLUG
          }
        ]
      }
    }
  ){
    edges{
      cursor
      node{
        id
        postId
        link
        date
      }
    }
  }
}

The same query in PHP using WP_Query would look like:

$args = [
    'tax_query' => [
        'relation' => 'OR',
        [
            'terms' => ['graphql'],
            'taxonomy' => 'category',
            'operator' => 'IN',
            'field' => 'slug',
        ],
        [
            'terms' => ['wordpress'],
            'taxonomy' => 'post_tag',
            'operator' => 'IN',
            'field' => 'slug',
        ],
    ],
];

new WP_Query( $args );

Releases

3 releases.

Tag
Published
v0.2.0 latest
Nov 8, 2022 3 years ago
Oct 28, 2019 6 years ago
Aug 3, 2017 9 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

A grade

Security

WPGraphQL Tax Query 0.2.0 · audited by WP Registry

No security issues found.

Audited release
0.2.0
Findings
none
Worst severity
—
Content hash
e125187a3cb2e2868acd1a94…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.