Skip to content

Commit

Permalink
fix: correctly use filtered form fields when preparing the connection…
Browse files Browse the repository at this point in the history
… data.
  • Loading branch information
justlevine committed Feb 4, 2024
1 parent 486d9b3 commit 150d184
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Unreleased

- fix: Ensure `EmailField` inputs are hydrated when Email Confirmation is disabled. H/t @
Gytjarek.
- fix: Ensure `EmailField` inputs are hydrated when Email Confirmation is disabled. H/t @Gytjarek.
- fix: Correctly use filtered form fields when preparing the connection data. H/t @samuelhadsall

## v0.12.4

Expand Down
4 changes: 2 additions & 2 deletions src/Data/Connection/FormFieldsConnectionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static function resolve( $source, array $args, AppContext $context, Resol

$fields = self::filter_form_fields_by_connection_args( $source, $args );

$fields = self::prepare_data( $source );
$fields = self::prepare_data( $fields );

$connection = Relay::connectionFromArray( $fields, $args );

Expand Down Expand Up @@ -172,7 +172,7 @@ private static function filter_form_fields_by_connection_args( $fields, $args ):
if ( isset( $args['where']['pageNumber'] ) ) {
$page = absint( $args['where']['pageNumber'] );

$fields = array_filter( $fields, static fn ( $field ) => $page === (int) $field['pageNumber'] );
$fields = array_filter( $fields, static fn ( $field ) => $page === (int) $field->pageNumber );
}

return $fields;
Expand Down

0 comments on commit 150d184

Please sign in to comment.