Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

fix: deprecation warning #389

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}
},
];
Expand Down
Loading