diff --git a/CHANGELOG.md b/CHANGELOG.md index 49e94e8f..7e908143 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - dev: Refactor database ID resolution when the GraphQL `ID` type is indeterminate. Note: The following input args now work with both database and global IDs: `GfEntriesConnectionWhereArgs.formIds`, `GfFormsConnectionwhereArgs.formIds`. - docs: Add missing documentation regarding using `productValues` input when submitting forms. +- dev: Remove usage of deprecated `WPGraphQL\Data\DataSource::resolve_post_object()` method. ## v0.12.1 - Bug fix diff --git a/src/Type/WPObject/Entry/SubmittedEntry.php b/src/Type/WPObject/Entry/SubmittedEntry.php index e5e3c346..1e5a3e6b 100644 --- a/src/Type/WPObject/Entry/SubmittedEntry.php +++ b/src/Type/WPObject/Entry/SubmittedEntry.php @@ -11,7 +11,6 @@ namespace WPGraphQL\GF\Type\WPObject\Entry; use WPGraphQL\AppContext; -use WPGraphQL\Data\DataSource; use WPGraphQL\GF\Data\Factory; use WPGraphQL\GF\Interfaces\Field; use WPGraphQL\GF\Interfaces\TypeWithInterfaces; @@ -87,7 +86,7 @@ public static function get_fields() : array { 'post' => [ 'type' => 'Post', 'description' => __( 'For forms with Post fields, this is the post object that was created.', 'wp-graphql-gravity-forms' ), - 'resolve' => static fn ( $source, array $args, AppContext $context ) => ! empty( $source->postDatabaseId ) ? DataSource::resolve_post_object( $source->postDatabaseId, $context ) : null, + 'resolve' => static fn ( $source, array $args, AppContext $context ) => ! empty( $source->postDatabaseId ) ? $context->get_loader( 'post' )->load( $source->postDatabaseId ) : null, ], 'postDatabaseId' => [ 'type' => 'Int',