Skip to content

Commit d17264e

Browse files
authored
feat!: update connection resolvers (#412)
* feat!: refactor connection resolvers * chore: update deps
1 parent 7d9935f commit d17264e

12 files changed

+566
-427
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
- feat!: Refactor `FormsConnectionResolver` and `EntriesConnectionResolver` for compatibility with WPGraphQL v1.26.0 improvements.
6+
- chore!: Bump minimum WPGraphQL to v1.26.0
7+
- chore: Update Composer dev-dependencies and fix test compatibility with `wp-graphql-test-case` v3.0.x.
8+
59
## v0.12.6.1
610

711
This _patch_ release fixes the version number in the plugin header, which was incorrectly set to `0.12.5` instead of `0.12.6`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Our hope for this open source project is that it will enable more teams to lever
2727

2828
* PHP 7.4-8.2+
2929
* WordPress 5.4.1+
30-
* WPGraphQL 1.9.0+
30+
* WPGraphQL 1.26.0+
3131
* Gravity Forms 2.5+ (Recommend: v2.6+)
3232
* **Recommended**: [WPGraphQL Upload](https://github.com/dre1080/wp-graphql-upload) - used for [File Upload and Post Image submissions](docs/submitting-forms.md).
3333

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"codeception/phpunit-wrapper": "^9.0",
3636
"codeception/util-universalframework": "^1.0",
3737
"lucatume/wp-browser": "<3.5",
38-
"wp-graphql/wp-graphql-testcase": "~2.3",
38+
"wp-graphql/wp-graphql-testcase": "~3.0.1",
3939
"phpunit/phpunit": "^9.0",
4040
"phpstan/phpstan": "^1.2",
4141
"phpstan/extension-installer": "^1.1",

composer.lock

Lines changed: 372 additions & 269 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/actions-and-filters.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,13 @@ apply_filters( 'graphql_gf_can_view_entries', bool $can_view_entries, int $form_
147147
Filter the Submitted Entry's $query_args to allow folks to customize queries programmatically.
148148

149149
```php
150-
apply_filters( 'graphql_gf_entries_connection_query_args', array $query_args, mixed $source, array $args, AppContext $context, ResolveInfo $info );
150+
apply_filters( 'graphql_gf_entries_connection_query_args', array $query_args, \WPGraphQL\GF\Data\Connection\EntriesConnectionResolver $resolver );
151151
```
152152

153153
#### Parameters
154154

155-
* **`$query_args`** _(array)_ : The query args that will be passed to `GF_Query`.
156-
* **`$source`** _(mixed)_ : The source passed down the Resolve Tree.
157-
* **`$args`** _(array)_ : Array of arguments input in the field as part of the GraphQL query.
158-
* **`$context`** _(AppContext)_ : Object passed down the GraphQL tree.
159-
* **`$info`** _(ResolveInfo)_ : The ResolveInfo passed down the GraphQL tree.
155+
* **`$query_args`** _(array<string,mixed>)_ : The query args that will be passed to `GF_Query`.
156+
* **`$resolver`** _(WPGraphQL\GF\Data\Connection\EntriesConnectionResolver)_ : The resolver object.
160157

161158
### `graphql_gf_field_value_input_class`
162159

@@ -234,16 +231,13 @@ apply_filters( 'graphql_gf_field_value_input_prepared_value', array|string $prep
234231
Filter the Form $query_args to allow folks to customize queries programmatically.
235232

236233
```php
237-
apply_filters( 'graphql_gf_forms_connection_query_args', array $query_args, mixed $source, array $args, AppContext $context, ResolveInfo $info );
234+
apply_filters( 'graphql_gf_forms_connection_query_args', array $query_args, \WPGraphQL\GF\Data\Connection\FormsConnectionResolver $resolver );
238235
```
239236

240237
#### Parameters
241238

242-
* **`$query_args`** _(array)_ : The query args that will be passed to `GFAPI::get_forms()`.
243-
* **`$source`** _(mixed)_ : The source passed down the Resolve Tree.
244-
* **`$args`** _(array)_ : Array of arguments input in the field as part of the GraphQL query.
245-
* **`$context`** _(AppContext)_ : Object passed down the GraphQL tree.
246-
* **`$info`** _(ResolveInfo)_ : The ResolveInfo passed down the GraphQL tree.
239+
* **`$query_args`** _(array<string,mixed>)_ : The query args that will be passed to `GFAPI::get_forms()`.
240+
* **`$resolver`** _(\WPGraphQL\GF\Data\Connection\FormsConnectionResolver)_ : The resolver object.
247241

248242
### `graphql_gf_form_field_child_types`
249243

@@ -402,12 +396,13 @@ apply_filters( 'graphql_gf_form_fields_name_map', array $fields_to_map );
402396
Filter to modify the form data before it is sent to the client. This hook is somewhat similar to GF's `gform_pre_render` hook, and can be used for dynamic field input population among other things.
403397

404398
```php
405-
apply_filters( 'graphql_gf_form_object', array $form );
399+
apply_filters( 'graphql_gf_form_object', array $form, \WPGraphQL\GF\Data\Connection\FormsConnectionResolver $resolver );
406400
```
407401

408402
#### Parameters
409403

410-
* **`$form`** _(array)_ : The GF [Form object](https://docs.gravityforms.com/form-object/).
404+
* **`$form`** _(array<string,mixed>)_ : The GF [Form object](https://docs.gravityforms.com/form-object/).
405+
* **`$resolver`** _(\WPGraphQL\GF\Data\Connection\FormsConnectionResolver)_ : The resolver object.
411406

412407
### `graphql_gf_gatsby_enabled_actions`
413408

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Requires at least: 5.4.1
55
Tested up to: 6.5
66
Requires PHP: 7.4
77
Requires Gravity Forms: 2.5.0
8-
Requires WPGraphQL: 1.9.0
8+
Requires WPGraphQL: 1.26.0
99
Stable tag: 0.12.6.1
1010
Maintained at: https://github.com/axewp/wp-graphql-gravity-forms
1111
License: GPL-3

0 commit comments

Comments
 (0)