Skip to content

Commit aa93592

Browse files
authored
release: v0.13.0 (#436)
* chore: cleanup and version bump * chore: add breaking schema changes
1 parent 65a2fa1 commit aa93592

File tree

17 files changed

+104
-49
lines changed

17 files changed

+104
-49
lines changed

.phpcs.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
<!-- What to scan: include any root-level PHP files, and the /src folder -->
66
<file>./src/</file>
7+
<file>./activation.php</file>
8+
<file>./deactivation.php</file>
79
<file>./wp-graphql-gravity-forms.php</file>
810
<exclude-pattern>/vendor/</exclude-pattern>
911
<exclude-pattern>/node_modules/</exclude-pattern>
1012
<exclude-pattern>/phpstan/</exclude-pattern>
11-
<exclude-pattern>*/tests/*</exclude-pattern>
1213

1314
<!-- How to scan -->
1415
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
@@ -61,8 +62,7 @@
6162
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
6263
<properties>
6364
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
64-
<!-- @todo drop gf_graphql -->
65-
<property name="prefixes" type="array" value="WPGraphQL\GF, wp_graphql, gf_graphql, graphql_gf, _gf, WPGRAPHQL_GF" />
65+
<property name="prefixes" type="array" value="WPGraphQL\GF, wp_graphql, graphql_gf, _gf, WPGRAPHQL_GF" />
6666
</properties>
6767
</rule>
6868
<rule ref="WordPress.WP.I18n">

CHANGELOG.md

Lines changed: 74 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,85 @@
22

33
## [Unreleased]
44

5-
- feat!: Implement `FormField` model and `DataLoader`, and refactor `FormFieldsConnectionResolver` to extend `AbstractConnectionResolver`.
6-
- feat!: Refactor `FormsConnectionResolver` and `EntriesConnectionResolver` for compatibility with WPGraphQL v1.26.0 improvements.
7-
- feat!: Narrow `FormField.choices` and `FormField.inputs` field types to their implementations.
8-
- feat: Add `targetPageNumber` and `targetPageFormFields` to `SubmitGfFormPayload` for better multi-page form support.
9-
- fix!: Keep `PageField` with previous page data when filtering `formFields` by `pageNumber`. H/t @SamuelHadsall .
10-
- fix: Handle RadioField submission values when using a custom "other" choice. H/t @Gytjarek .
5+
## v0.13.0
6+
7+
**:warning: This release contains multiple breaking changes.**
8+
9+
This _major_ release leverages new WPGraphQL v1.26 features to enhance our schema and resolvers. The `FormsConnectionResolver` and `EntriesConnectionResolver` have been refactored to take advantage of upstream API changes, and a new `FormField` model, `Dataloader`, and `ConnectionResolver` is used to boost performance and flexibility. The schema DX by narrowing down types from their interfaces, we've adding other new features, bug fixes, and code quality improvements.
10+
11+
In this release, we've also removed the `vendor` directory from the GitHub repository. If you have been downloading the plugin's source code instead of the release zip, you will need to run `composer install` to install the required dependencies.
12+
13+
**Note:** As a result of these changes, the following minimum versions have been bumped:
14+
- WPGraphQL: v1.26.0
15+
- WordPress: v6.0.0
16+
- Gravity Forms: v2.7.0
17+
18+
### What's New:
19+
20+
- We've added support for the Gravity Forms Block when using WPGraphQL Content Blocks, by exposing the `GfForm` on the `GravityformsFormAttributes.form` field.
21+
22+
- We've implemented a complete `Model`->`Dataloader`->`ConnectionResolver` pattern for Form Fields. As a result resolving form field data is significantly more performant and flexible, and our FormField connections are fully Relay compliant.
23+
- **🚨 Breaking**: The deprecated (int) `FormField.id` has been reinstated as a relay-compliant `ID`. If you are still using `id` as the integer database ID, you will need to update your queries to use `FormField.databaseId`.
24+
- **🚨 Breaking**: Form Field resolvers now return a `FormField` model instead of the underlying form. While you can update your custom resolvers to access the underlying form via `$source->gfForm`, it's recommended to rely on the `Model`'s fields for better performance and reliability.
25+
- Thanks to the new dataloader, we can now more easily and scalably resolve `FormField`s in more places in the schema. In this release we have:
26+
- Added the `FieldError.connectedFormField` field.
27+
- Deprecated (int) `GfFieldWithProductFieldSetting.productField` in favor of `.connectedProductField`.
28+
- Updated our existing `.connectedFormField`s across the schema to use the new Dataloader.
29+
- Exposed `SubmitGfFormPayload.targetPageFormFields` to help with multi-page form support. See notes below for more information.
30+
31+
- **🚨 Breaking**: We've improved the DX for `FormField.choices` and `.inputs` by narrowing down the field definitions on the implementing Types. For example, instead of `CheckboxField.choices` resolving to a generic `GfFieldChoice` interface, it now resolves directly to `CheckboxFieldChoice.
32+
33+
**Note**: If your queries are checking for "impossible" interfaces, (e.g. `... on ListFieldChoice` on a `CheckboxField.choices` query), you will need to update your queries. A full list of breaking schema changes can be found below.
34+
35+
36+
- We've improved the DX and handling of multi-page forms:
37+
- **🚨 Breaking**: `PageField`s are now paginated to be at the _bottom of the previous page_, instead of at the top of the following page. H/t @SamuelHadsall.
38+
39+
**Note**: If you are currently working around the old pagination on your frontend (e.g. overfetching and post-processing your `formFields`), you may need to update your code.
40+
41+
- We've added `targetPageNumber` and `targetPageFormFields` to the `SubmitGfFormPayload` to help with multi-page form support, allowing you to fetch, submit, and validate a single page at a time before navigating to the next page. Check out the updated docs for more information and usage.
42+
43+
- **🚨 Breaking**: We've refactored the `EntriesConnectionResolver` and `FormsConnectionResolver` classes to use the new API methods available as of WPGraphQL v1.26.0, leading to improved performance and reliability.
44+
45+
**Note**: If you are extending these classes in your custom code, you will need to update your code to match the new method signatures.
46+
47+
- **🚨 Breaking**: We've removed the following _deprecated_ code. If you are still referencing these in your GraphQL queries or custom PHP, you will need to update your code:
48+
- Deprecated GraphQL fields: `FormsConnectionOrderbyInput.field`, `GfFieldWithDisableQuantitySetting.isQuantityDisabled`. `GfSubmittedEntry.entryId`. `GfForm.button`, `gfForm.entryId`, `gfForm.lastPageButton`.
49+
- Deprecated hooks: `graphql_gf_form_modeled_data_experimental`, `graphql_gf_form_field_setting_properties`, `graphql_gf_form_field_value_properties`.
50+
- Deprecated helper methods: `GFUtils::handle_file_upload()`.
51+
52+
### Breaking Schema Changes
53+
- Field `FormField.id` changed type from `Int!` to `ID!`
54+
- Field `{$TYPE}Field.inputs` changed type from `[GfFieldInput]` to `[{$TYPE}InputProperty]`
55+
- Field `{$TYPE}Field.choices` changed type from `[GfFieldChoice]` to `[{$TYPE}FieldChoice]`
56+
- Field `values` (deprecated) was removed from object type `FileUploadField`
57+
- Input field `field` (deprecated) was removed from input object type `FormsConnectionOrderbyInput`
58+
- Field `isQuantityDisabled` (deprecated) was removed from interface `GfFieldWithDisableQuantitySetting`
59+
- Field `button` (deprecated) was removed from object type `GfForm`
60+
- Field `formId` (deprecated) was removed from object type `GfForm`
61+
- Field `lastPageButton` (deprecated) was removed from object type `GfForm`
62+
- Field `entryId` (deprecated) was removed from object type `GfSubmittedEntry`
63+
64+
### Fixes
65+
- fix: Add missing descriptions to various GraphQL types.
1166
- fix: Check for Submission Confirmation url before attempting to get the associated post ID.
1267
- fix: Flush static Gravity Forms state between multiple calls to `GFUtils::submit_form()`.
13-
- fix: Add missing descriptions to types.
14-
- feat: Add `FieldError.connectedFormField` connection to `FieldError` type.
15-
- feat: Add support for WPGraphQL Content Blocks.
16-
- feat: Add `GfFieldWithProductFieldSetting.connectedProductField` connection and deprecate `.productField` field.
17-
- dev: Remove `vendor` directory from the GitHub repository.
18-
- dev: Use `FormFieldsDataLoader` to resolve fields instead of instantiating a new `Model`.
19-
- dev: use WP_Filesystem to handle Signature field uploads.
20-
- chore!: Remove deprecated fields from the schema: `FormsConnectionOrderbyInput.field`, `GfFieldWithDisableQuantitySetting.isQuantityDisabled`. `GfSubmittedEntry.entryId`. `GfForm.button`, `gfForm.entryId`, `gfForm.lastPageButton`.
21-
- chore!: Remove deprecated hooks: `graphql_gf_form_modeled_data_experimental`, `graphql_gf_form_field_setting_properties`, `graphql_gf_form_field_value_properties`.
22-
- chore!: Remove deprecated helper method: `GFUtils::handle_file_upload()`.
23-
- chore: Add iterable type hints.
24-
- chore!: Bump minimum WPGraphQL version to v1.26.0.
25-
- chore!: Bump minimum WordPress version to v6.0.0.
26-
- chore!: Bump minimum Gravity Forms version to v2.7.0.
27-
- chore: Update PHP interfaces and Abstract classes with better type hints.
28-
- chore: Declare `strict_types` in all PHP files.
68+
- fix: Handle `RadioField` submission values when using a custom "other" choice. H/t @Gytjarek .
69+
70+
### Behind the Scenes
71+
- dev: Add new `graphql_gf_activate` and `graphql_gf_deactivate` actions.
72+
- dev: Deprecate `FieldValues::is_field_and_entry()` and remove internal usage.
73+
- dev: Remove `vendor` directory from the GitHub repository, and improve plugin initialization and autoload handling.
74+
- dev: use `WP_Filesystem` to handle Signature field uploads.
75+
- chore: Declare `strict_types` in all PHP files, add type hints to all iterable types. and fix exposed type errors.
2976
- chore: Update Composer dev-dependencies and fix test compatibility with `wp-graphql-test-case` v3.0.x.
30-
- docs: Add docs on using Multi-page forms.
77+
- chore: Update PHP interfaces and Abstract classes with better type hints.
78+
- chore!: Bump minimum Gravity Forms version to v2.7.0.
79+
- chore!: Bump minimum WordPress version to v6.0.0.
80+
- chore!: Bump minimum WPGraphQL version to v1.26.0.
3181
- tests: Add test for `GFUtils::get_last_form_page()`.
3282

83+
3384
## v0.12.6.1
3485

3586
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ A WordPress plugin that adds <a href="https://wpgraphql.com" target="_blank">WPG
88

99
-----
1010

11-
![Packagist License](https://img.shields.io/packagist/l/harness-software/wp-graphql-gravity-forms?color=green) ![Packagist Version](https://img.shields.io/packagist/v/harness-software/wp-graphql-gravity-forms?label=stable) ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/axewp/wp-graphql-gravity-forms/v0.12.6.1) ![GitHub forks](https://img.shields.io/github/forks/axewp/wp-graphql-gravity-forms?style=social) ![GitHub Repo stars](https://img.shields.io/github/stars/axewp/wp-graphql-gravity-forms?style=social)<br />
12-
![Packagist License](https://img.shields.io/packagist/l/harness-software/wp-graphql-gravity-forms?color=green) ![Packagist Version](https://img.shields.io/packagist/v/harness-software/wp-graphql-gravity-forms?label=stable) ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/axewp/wp-graphql-gravity-forms/v0.12.6.1) ![GitHub forks](https://img.shields.io/github/forks/axewp/wp-graphql-gravity-forms?style=social) ![GitHub Repo stars](https://img.shields.io/github/stars/axewp/wp-graphql-gravity-forms?style=social)<br />
11+
![Packagist License](https://img.shields.io/packagist/l/harness-software/wp-graphql-gravity-forms?color=green) ![Packagist Version](https://img.shields.io/packagist/v/harness-software/wp-graphql-gravity-forms?label=stable) ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/axewp/wp-graphql-gravity-forms/v0.13.0) ![GitHub forks](https://img.shields.io/github/forks/axewp/wp-graphql-gravity-forms?style=social) ![GitHub Repo stars](https://img.shields.io/github/stars/axewp/wp-graphql-gravity-forms?style=social)<br />
12+
![Packagist License](https://img.shields.io/packagist/l/harness-software/wp-graphql-gravity-forms?color=green) ![Packagist Version](https://img.shields.io/packagist/v/harness-software/wp-graphql-gravity-forms?label=stable) ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/axewp/wp-graphql-gravity-forms/v0.13.0) ![GitHub forks](https://img.shields.io/github/forks/axewp/wp-graphql-gravity-forms?style=social) ![GitHub Repo stars](https://img.shields.io/github/stars/axewp/wp-graphql-gravity-forms?style=social)<br />
1313
[![Coverage Status](https://coveralls.io/repos/github/AxeWP/wp-graphql-gravity-forms/badge.svg?branch=develop)](https://coveralls.io/github/AxeWP/wp-graphql-gravity-forms?branch=develop) [![WordPress Coding Standards](https://github.com/axewp/wp-graphql-gravity-forms/actions/workflows/code-standard.yml/badge.svg)](https://github.com/axewp/wp-graphql-gravity-forms/actions/workflows/code-standard.yml) [![Code Quality](https://github.com/axewp/wp-graphql-gravity-forms/actions/workflows/code-quality.yml/badge.svg)](https://github.com/axewp/wp-graphql-gravity-forms/actions/workflows/code-quality.yml) [![Schema Linter](https://github.com/axewp/wp-graphql-gravity-forms/actions/workflows/schema-linter.yml/badge.svg)](https://github.com/axewp/wp-graphql-gravity-forms/actions/workflows/schema-linter.yml)
1414

1515
## Overview

activation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Activation Hook
44
*
55
* @package WPGraphql\GF
6+
* @since 0.13.0
67
*/
78

89
declare( strict_types = 1 );

deactivation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Deactivation Hook
44
*
55
* @package WPGraphql\GF
6+
* @since 0.13.0
67
*/
78

89
declare( strict_types = 1 );

0 commit comments

Comments
 (0)