diff --git a/README.md b/README.md index 320adcd..d455912 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,24 @@ # WPGraphQL for Advanced Custom Fields +---- + +🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 + +This plugin has gone through a complete re-architecture and this repository will soon be archived. + +We recommend you upgrade to the new WPGraphQL for ACF v2.0+ at your earliest convenience. + +The new version contains breaking changes, so update with caution. Below are some resources to help: + +- UPGRADE GUIDE: https://acf.wpgraphql.com/upgrade-guide +- NEW PLUGIN REPO: https://github.com/wp-graphql/wpgraphql-acf +- NEW PLUGIN ON WORDPRESS.ORG: https://wordpress.org/plugins/wpgraphql-acf +- NEW PLUGIN ON COMPOSER: https://packagist.org/packages/wp-graphql/wpgraphql-acf +- NEW PLUGIN ON WPPACKAGIST: https://wpackagist.org/search?q=wpgraphql-acf&type=any&search= + +🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 +---- + WPGraphQL for Advanced Custom Fields automatically exposes your ACF fields to the WPGraphQL Schema. - [Install and Activate](#install-and-activate) diff --git a/readme.txt b/readme.txt index 0d966cd..ec87d7f 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://wpgraphql.com/acf Tags: WPGraphQL, GraphQL, API, Advanced Custom Fields, ACF Requires at least: 5.0 Tested up to: 5.1.1 -Stable tag: 0.6.1 +Stable tag: 0.6.2 License: GPL-3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -21,6 +21,11 @@ SEE: https://github.com/wp-graphql/wp-graphql-acf/releases == Upgrade Notice == += 0.6.2 = + +NOTE: This is the final release of this plugin. Please migrate to the [new WPGraphQL for ACF](https://github.com/wp-graphql/wpgraphql-acf) at your earliest convenience. + + = 0.1.1 = ACF Field groups were not properly being added to the GraphQL Schema for Custom Post Types. This addresses that issue, so now Field groups that are set to "show_in_graphql" and are assigned to a diff --git a/src/class-config.php b/src/class-config.php index 6c95901..b0091a8 100644 --- a/src/class-config.php +++ b/src/class-config.php @@ -799,7 +799,7 @@ protected function register_graphql_field( string $type_name, string $field_name 'resolve' => function( $root, $args, $context, $info ) use ( $acf_field ) { $value = $this->get_acf_field_value( $root, $acf_field ); - return DataSource::resolve_post_object( (int) $value, $context ); + return $context->get_loader( 'post' )->load_deferred( (int) $value ); }, ]; break; @@ -903,11 +903,11 @@ protected function register_graphql_field( string $type_name, string $field_name */ if ( ! empty( $value ) && is_array( $value ) ) { foreach ( $value as $term ) { - $terms[] = DataSource::resolve_term_object( (int) $term, $context ); + $terms[] = $context->get_loader( 'term' )->load_deferred( (int) $term ); } return $terms; } else { - return DataSource::resolve_term_object( (int) $value, $context ); + return $context->get_loader( 'term' )->load_deferred( (int) $value ); } }, ]; diff --git a/wp-graphql-acf.php b/wp-graphql-acf.php index 520764a..f358e7c 100644 --- a/wp-graphql-acf.php +++ b/wp-graphql-acf.php @@ -7,7 +7,7 @@ * Author URI: https://www.wpgraphql.com * Text Domain: wp-graphql-acf * Domain Path: /languages - * Version: 0.6.1 + * Version: 0.6.2 * Requires PHP: 7.0 * GitHub Plugin URI: https://github.com/wp-graphql/wp-graphql-acf * @@ -26,7 +26,7 @@ * Define constants */ const WPGRAPHQL_REQUIRED_MIN_VERSION = '0.4.0'; -const WPGRAPHQL_ACF_VERSION = '0.6.1'; +const WPGRAPHQL_ACF_VERSION = '0.6.2'; /** * Initialize the plugin