Skip to content

Commit

Permalink
dev: remove call to deprecated resolve_post_object() (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine committed Jun 2, 2023
1 parent e2968ac commit 17dcb6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions src/Type/WPObject/Entry/SubmittedEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 17dcb6d

Please sign in to comment.