{"id":13466814,"url":"https://github.com/wp-graphql/wp-graphql-meta-query","last_synced_at":"2025-06-30T20:06:29.391Z","repository":{"id":43316399,"uuid":"81971132","full_name":"wp-graphql/wp-graphql-meta-query","owner":"wp-graphql","description":"WPGraphQL Extension: Adds \"meta_query\" support to postObject connection queries using WP_Query","archived":false,"fork":false,"pushed_at":"2024-06-14T08:48:51.000Z","size":83,"stargazers_count":55,"open_issues_count":18,"forks_count":19,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-06-20T10:23:10.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wpgraphql.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-14T17:28:56.000Z","updated_at":"2025-05-18T05:45:15.000Z","dependencies_parsed_at":"2024-11-06T05:44:18.256Z","dependency_job_id":null,"html_url":"https://github.com/wp-graphql/wp-graphql-meta-query","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.0625,"last_synced_commit":"ab7f535bef8bc607d6d86c51638d5444f2fc922c"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wp-graphql/wp-graphql-meta-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-meta-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-meta-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-meta-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-meta-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-meta-query/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-meta-query/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262554565,"owners_count":23327741,"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.314Z","updated_at":"2025-06-30T20:06:29.355Z","avatar_url":"https://github.com/wp-graphql.png","language":"PHP","funding_links":[],"categories":["Plugins"],"sub_categories":["WordPress"],"readme":"# WPGraphQL Meta Query\nThis plugin adds Meta_Query support to the WP GraphQL Plugin for postObject query args.\n\n\n## Why is this an extension and not part of WPGraphQL?\n\nMeta Queries _can_ be expensive and have been known to actually take sites down, which is why they are not\npart of the core WPGraphQL plugin. \n\nIf you need meta queries for your WPGraphQL system, this plugin enables them, but use with caution. It might be better\nto hook into WPGraphQL and define specific meta queries that you _know_ you need and are not going to take your system \ndown instead of allowing just any meta_query via this plugin, but you could use this plugin as an example of how\nto hook into WPGraphQL to add inputs and map those inputs to the WP_Query that gets executed.\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. Requires WPGraphQL 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 `metaQuery` 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 metaQuery input on a `posts` query. (Go ahead and check things out in \u003ca target=\"_blank\" href=\"https://chrome.google.com/webstore/detail/chromeiql/fkkiamalmpiidkljmicmjfbieiclmeij?hl=en\"\u003eGraphiQL\u003c/a\u003e)\n\nThis will find `posts` that have `some_value` as the value of the post_meta field with the key of `some_key` AND also \nDOES NOT have `some_other_value` as the value for the post_meta key `some_other_key`\n\n```\nquery{\n  posts(\n    where: {\n      metaQuery: {\n        relation: AND\n        metaArray: [\n          {\n            key: \"some_key\",\n            value: \"some_value\"\n            compare: EQUAL_TO\n          },\n          {\n            key: \"some_other_key\",\n            value: \"some_other_value\",\n            compare: NOT_EQUAL_TO\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    'meta_query' =\u003e [\n        'relation' =\u003e 'AND',\n        [\n            'key' =\u003e 'some_key',\n            'value' =\u003e 'some_value',\n            'compare' =\u003e 'EQUAL TO',\n        ],\n        [\n            'key' =\u003e 'some_other_key',\n            'value' =\u003e 'some_other_value',\n            'compare' =\u003e 'NOT EQUAL TO',\n        ],\n    ],\n];\n\nnew WP_Query( $args );\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-graphql%2Fwp-graphql-meta-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-graphql%2Fwp-graphql-meta-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-graphql%2Fwp-graphql-meta-query/lists"}