Search by

superhuit / wp-graphql-redirection

superhuit

Exposes Redirection WP plugin in the WP-GraphQL schema

Package info

github.com/superhuit-agency/wp-graphql-redirection

Type:wordpress-plugin

pkg:composer/superhuit/wp-graphql-redirection

Statistics

Installs: 4 541

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 2

v2.0.4 2026-10-14 06:47 UTC

This package is auto-updated.

Last update: 2026-11-01 12:38:08 UTC


README

Exposes Redirection plugin in the GraphQL schema.

Requirements

Install and Activate

WPGraphQl Redirection is a WordPress Plugin. YOu must then have a running WordPress instance with both WPGraphQL and Redirection plugins installed and activated.

Installing From Github

To install the plugin from Github, you can download the latest release zip file, upload the Zip file to your WordPress install, and activate the plugin.

Click here to learn more about installing WordPress plugins from a Zip file.

Installing from Composer

composer require superhuit/wp-graphql-redirection

Example

query getAllRedirections {
  redirections {
    code
    target
    url
  }
}

query getTheRedirection($uri: String!) {
  redirections(uri: $uri) {
    code
    target
    url
  }
}

redirections (and isRedirected) only take active redirects into account: enabled redirects, in enabled groups of the WordPress module. Disabled redirects, and redirects in disabled groups or in Apache/Nginx groups, are left out.

WPGraphQL Smart Cache

When WPGraphQL Smart Cache is active, queries selecting redirections are not object-cached, and they are not tagged with the list:redirectionitemtype list type. Frontends usually look up redirections(uri:) on every page render, so that shared cache collection would otherwise grow with every URL rendered, and nothing purges it when a redirect changes. Redirects take effect on the next lookup that reaches WordPress (a network cache in front of GET requests still keeps responses for their max-age).

Keep the lookup in its own request: a query mixing redirections with other root fields isn't object-cached either, yet Smart Cache still maps its key, once per URI, into the collections of those other fields.

Tests

composer install
composer test