{"id":13466825,"url":"https://github.com/wp-graphql/wp-graphql-tax-query","last_synced_at":"2025-06-22T04:13:02.039Z","repository":{"id":45685766,"uuid":"81971174","full_name":"wp-graphql/wp-graphql-tax-query","owner":"wp-graphql","description":"Adds `tax_query` support to postObject connection queries using WP_Query","archived":false,"fork":false,"pushed_at":"2022-11-08T17:13:28.000Z","size":36,"stargazers_count":51,"open_issues_count":19,"forks_count":17,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-06-20T10:22:46.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-graphql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-14T17:29:22.000Z","updated_at":"2025-06-20T10:19:35.000Z","dependencies_parsed_at":"2022-09-10T08:20:18.426Z","dependency_job_id":null,"html_url":"https://github.com/wp-graphql/wp-graphql-tax-query","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wp-graphql/wp-graphql-tax-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-tax-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-tax-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-tax-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-tax-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-graphql","download_url":"https://codeload.github.com/wp-graphql/wp-graphql-tax-query/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-tax-query/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261069107,"owners_count":23105155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:00:50.453Z","updated_at":"2025-06-22T04:12:57.015Z","avatar_url":"https://github.com/wp-graphql.png","language":"PHP","funding_links":[],"categories":["Plugins"],"sub_categories":["WordPress"],"readme":"# WPGraphQL Tax Query\n\nThis plugin adds Tax_Query support to the WP GraphQL Plugin for postObject query args (WP_Query).\n\n## Pre-req's\nUsing this plugin requires having the \u003ca href=\"https://github.com/wp-graphql/wp-graphql\" target=\"_blank\"\u003eWPGraphQL plugin\u003c/a\u003e installed\nand activated. (version 0.0.15 or newer)\n\n## Activating / Using\nActivate the plugin like you would any other WordPress plugin.\n\nOnce the plugin is active, the `taxQuery` argument will be available to any post object connectionQuery\n(posts, pages, custom post types, etc).\n\n## Example Query\nBelow is an example Query using the taxQuery input on a `posts` query. (Go ahead and check things out in\n\u003ca target=\"_blank\" href=\"https://chrome.google.com/webstore/detail/chromeiql/fkkiamalmpiidkljmicmjfbieiclmeij?hl=en\"\u003eGraphiQL\u003c/a\u003e)\n\nThis will find `posts` that are in the category \"graphql\" OR tagged with \"wordpress\".\n\n```\nquery{\n  posts(\n    where: {\n      taxQuery: {\n        relation: OR,\n        taxArray: [\n          {\n            terms: [\"graphql\"],\n            taxonomy: CATEGORY,\n            operator: IN,\n            field: SLUG\n          },\n          {\n            terms: [\"wordpress\"],\n            taxonomy: TAG,\n            operator: IN,\n            field: SLUG\n          }\n        ]\n      }\n  \t}\n  ){\n    edges{\n      cursor\n      node{\n        id\n        postId\n        link\n        date\n      }\n    }\n  }\n}\n```\n\nThe same query in PHP using WP_Query would look like:\n\n```\n$args = [\n    'tax_query' =\u003e [\n        'relation' =\u003e 'OR',\n        [\n            'terms' =\u003e ['graphql'],\n            'taxonomy' =\u003e 'category',\n            'operator' =\u003e 'IN',\n            'field' =\u003e 'slug',\n        ],\n        [\n            'terms' =\u003e ['wordpress'],\n            'taxonomy' =\u003e 'post_tag',\n            'operator' =\u003e 'IN',\n            'field' =\u003e 'slug',\n        ],\n    ],\n];\n\nnew WP_Query( $args );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-graphql%2Fwp-graphql-tax-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-graphql%2Fwp-graphql-tax-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-graphql%2Fwp-graphql-tax-query/lists"}