From dcd4cc8645519054ae0e33ed904fcf52cbd60202 Mon Sep 17 00:00:00 2001 From: Buya Date: Thu, 15 Sep 2022 16:19:06 +0800 Subject: [PATCH] Adding redirection id to schema I'm using Apollo and WPGraphQL. The ID is required in order to update redirection's data such as hits and last accessed. --- wp-graphql-redirection.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-graphql-redirection.php b/wp-graphql-redirection.php index 28cb6c5..0921200 100755 --- a/wp-graphql-redirection.php +++ b/wp-graphql-redirection.php @@ -65,6 +65,7 @@ 'wp-graphql-redirection' ), 'fields' => [ + 'id' => ['type' => 'Int'], 'origin' => ['type' => 'String'], 'target' => ['type' => 'String'], 'type' => ['type' => 'String'], @@ -111,6 +112,7 @@ foreach ((array) $rows as $row) { $items[] = [ + 'id' => $row->id, 'origin' => $row->url, 'target' => $row->action_data, 'code' => absint($row->action_code),