diff --git a/readme.txt b/readme.txt index e6b1895b..3db75e15 100644 --- a/readme.txt +++ b/readme.txt @@ -24,6 +24,14 @@ In order to use v0.2.0+ of WPGraphQL Smart Cache, you will need WPGraphQL v1.12. == Changelog == += 0.2.2 = + +- fix bug with patch. Missing namespace + += 0.2.1 = + +- add patch for wp-engine customers. will be removed when the wp-engine mu plugin is updated + = 0.2.0 - chore: remove unreferenced .zip build artifact diff --git a/wp-graphql-smart-cache.php b/wp-graphql-smart-cache.php index 6f636adc..3344ac94 100644 --- a/wp-graphql-smart-cache.php +++ b/wp-graphql-smart-cache.php @@ -11,7 +11,7 @@ * Requires PHP: 7.4 * Text Domain: wp-graphql-smart-cache * Domain Path: /languages - * Version: 0.2.0 + * Version: 0.2.2 * License: GPL-3 * License URI: https://www.gnu.org/licenses/gpl-3.0.html * @@ -35,7 +35,7 @@ } const WPGRAPHQL_REQUIRED_MIN_VERSION = '1.2.0'; -const WPGRAPHQL_SMART_CACHE_VERSION = '0.2.0'; +const WPGRAPHQL_SMART_CACHE_VERSION = '0.2.2'; require __DIR__ . '/vendor/autoload.php'; @@ -188,3 +188,13 @@ function () { $invalidation->init(); } ); + +add_action( 'graphql_purge', function( $purge_keys ) { + if ( ! function_exists( 'graphql_get_endpoint_url' ) || ! method_exists( 'WpeCommon', 'http_to_varnish' ) ) { + return; + } + \WpeCommon::http_to_varnish( 'PURGE_GRAPHQL', null, [ + 'GraphQL-Purge-Keys' => $purge_keys, + 'GraphQL-URL' => graphql_get_endpoint_url(), + ] ); +}, 0, 1 );