Skip to content

Commit

Permalink
Merge pull request #124 from wp-graphql/release/v2.0.0-beta.6.0.0
Browse files Browse the repository at this point in the history
release: v2.0.0-beta.6.0.0
  • Loading branch information
jasonbahl authored Nov 15, 2023
2 parents e2c8a30 + 6789828 commit 3bceaca
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 2.0.0-beta.6.0.0

### New Features

- [#114](https://github.com/wp-graphql/wpgraphql-acf/pull/114): feat: add pre filter for resolve type

### Chores / Bugfixes

- [#111](https://github.com/wp-graphql/wpgraphql-acf/pull/111): fix: oembed field type returns embed instead of URL entered to the field
- [#112](https://github.com/wp-graphql/wpgraphql-acf/pull/112): fix: field groups on page templates not resolving
- [#116](https://github.com/wp-graphql/wpgraphql-acf/pull/116): fix: error when querying `post_object`, `relationship` or `page_link` field nested on a `repeater` or `flexible_content` field
- [#122](https://github.com/wp-graphql/wpgraphql-acf/pull/122): ci: update tests to run against WordPress 6.4

## 2.0.0-beta.5.1.0

### Chores / Bugfixes
Expand Down
22 changes: 14 additions & 8 deletions src/FieldType/Relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,24 @@ public static function get_graphql_type( FieldConfig $field_config, AcfGraphQLFi
$ids = $value;
}

$ids = array_map(
static function ( $id ) {
if ( is_object( $id ) && isset( $id->ID ) ) {
$id = $id->ID;
}
return absint( $id );
},
$ids
$ids = array_filter(
array_map(
static function ( $id ) {
if ( is_object( $id ) && isset( $id->ID ) ) {
$id = $id->ID;
}
// filter out values that are not IDs
// this means that external urls or urls to things like
// archive links will not resolve.
return absint( $id ) ?: null;
},
$ids
)
);

$resolver = new PostObjectConnectionResolver( $root, $args, $context, $info, 'any' );


if ( $is_one_to_one ) {
$resolver = $resolver->one_to_one();
}
Expand Down
4 changes: 2 additions & 2 deletions wp-graphql-acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Re-imagining the WPGraphQL for ACF plugin
* Author: WPGraphQL, Jason Bahl
* Author URI: https://www.wpgraphql.com
* Version: 2.0.0-beta.5.1.0
* Version: 2.0.0-beta.6.0.0
* Text Domain: wp-graphql-acf
* Requires PHP: 7.3
* Requires at least: 5.9
Expand All @@ -29,7 +29,7 @@
}

if ( ! defined( 'WPGRAPHQL_FOR_ACF_VERSION' ) ) {
define( 'WPGRAPHQL_FOR_ACF_VERSION', '2.0.0-beta.5.1.0' );
define( 'WPGRAPHQL_FOR_ACF_VERSION', '2.0.0-beta.6.0.0' );
}

if ( ! defined( 'WPGRAPHQL_FOR_ACF_VERSION_WPGRAPHQL_REQUIRED_MIN_VERSION' ) ) {
Expand Down

0 comments on commit 3bceaca

Please sign in to comment.