Skip to content

Commit 8478368

Browse files
committed
- update Types in docblocks to be compatible with WPGraphQL v2 / graphql-php v15+
1 parent f806103 commit 8478368

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

readme.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ Tags: WPGraphQL, Cache, API, Invalidation, Persisted Queries, GraphQL, Performan
44
Requires at least: 5.6
55
Tested up to: 6.5
66
Requires PHP: 7.4
7-
Stable tag: 1.3.3
7+
Stable tag: 2.0.0
8+
Requires WPGraphQL: 2.0.0
9+
WPGraphQL Tested Up To: 2.0.0
810
License: GPLv2 or later
911
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1012

@@ -65,6 +67,10 @@ Learn more about how [Appsero collects and uses this data](https://appsero.com/p
6567

6668
== Upgrade Notice ==
6769

70+
= 2.0.0 =
71+
72+
This release includes breaking changes to be compatible with WPGraphQL 2.0.0. When upgrading WPGraphQL to v2.0.0, you must also upgrade WPGraphQL Smart Cache to v2.0.0. WPGraphQL Smart Cache v2.0.0 is not compatible with WPGraphQL v1.x.x.
73+
6874
= 1.3.0 =
6975

7076
This fixes a regression to WPGraphQL v1.20.0 where the Query Analyzer became optional and defaulted to "off". WPGraphQL Smart Cache force-enables the Query Analyzer to support Cache tagging and tag-based cache invalidation.
@@ -98,6 +104,14 @@ In order to use v0.2.0+ of WPGraphQL Smart Cache, you will need WPGraphQL v1.12.
98104

99105
== Changelog ==
100106

107+
= 2.0.0 =
108+
109+
**Breaking Changes**
110+
111+
- This release includes breaking changes to be compatible with WPGraphQL 2.0.0. When upgrading WPGraphQL to v2.0.0, you must also upgrade WPGraphQL Smart Cache to v2.0.0. WPGraphQL Smart Cache v2.0.0 is not compatible with WPGraphQL v1.x.x.
112+
113+
114+
101115
= 1.3.3 =
102116

103117
**Chores / Bugfixes**

src/Document/Loader.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ class Loader {
1414
/**
1515
* When a queryId is found on the request, this call back is invoked to look up the query
1616
* string
17-
* Can be invoked on GET or POST params
1817
*
19-
* @param string $query_id An array containing the pieces of the data of the GraphQL
20-
* request
21-
* @param array $operation_params An array containing the method, body and query params
18+
* @param string $query_id The persisted query ID
19+
* @param array $operation_params The operation parameters
2220
*
2321
* @return string|\GraphQL\Language\AST\DocumentNode
2422
*/
25-
public static function by_query_id( $query_id, $operation_params ) {
23+
public static function by_query_id( string $query_id, array $operation_params ) {
2624
$content = new Document();
2725
$query = $content->get( $query_id );
2826

wp-graphql-smart-cache.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
* Description: Smart Caching and Cache Invalidation for WPGraphQL
77
* Author: WPGraphQL
88
* Author URI: http://www.wpgraphql.com
9-
* Requires at least: 5.6
9+
* Requires at least: 6.0
1010
* Tested up to: 6.6.1
1111
* Requires PHP: 7.4
12+
* Requires WPGraphQL: 2.0.0
13+
* WPGraphQL Tested Up To: 2.0.0
1214
* Text Domain: wp-graphql-smart-cache
1315
* Domain Path: /languages
14-
* Version: 1.3.3
16+
* Version: 2.0.0
1517
* License: GPL-3
1618
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
1719
*
@@ -46,7 +48,7 @@
4648
}
4749

4850
if ( ! defined( 'WPGRAPHQL_SMART_CACHE_VERSION' ) ) {
49-
define( 'WPGRAPHQL_SMART_CACHE_VERSION', '1.3.3' );
51+
define( 'WPGRAPHQL_SMART_CACHE_VERSION', '2.0.0' );
5052
}
5153

5254
if ( ! defined( 'WPGRAPHQL_SMART_CACHE_WPGRAPHQL_REQUIRED_MIN_VERSION' ) ) {
@@ -100,7 +102,9 @@ function can_load_plugin() {
100102
'graphql_server_config',
101103
function ( \GraphQL\Server\ServerConfig $config ) {
102104
$config->setPersistedQueryLoader(
103-
[ Loader::class, 'by_query_id' ]
105+
function ( string $queryId, \GraphQL\Server\OperationParams $params ) {
106+
return Loader::by_query_id( $queryId, (array) $params );
107+
}
104108
);
105109
},
106110
10,

0 commit comments

Comments
 (0)