v0.13.0
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.
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.
Note: As a result of these changes, the following minimum versions have been bumped:
- WPGraphQL: v1.26.0
- WordPress: v6.0.0
- Gravity Forms: v2.7.0
What's New:
-
We've added support for the Gravity Forms Block when using WPGraphQL Content Blocks, by exposing the
GfFormon theGravityformsFormAttributes.formfield. -
We've implemented a complete
Model->Dataloader->ConnectionResolverpattern for Form Fields. As a result resolving form field data is significantly more performant and flexible, and our FormField connections are fully Relay compliant.- 🚨 Breaking: The deprecated (int)
FormField.idhas been reinstated as a relay-compliantID. If you are still usingidas the integer database ID, you will need to update your queries to useFormField.databaseId. - 🚨 Breaking: Form Field resolvers now return a
FormFieldmodel 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 theModel's fields for better performance and reliability. - Thanks to the new dataloader, we can now more easily and scalably resolve
FormFields in more places in the schema. In this release we have:- Added the
FieldError.connectedFormFieldfield. - Deprecated (int)
GfFieldWithProductFieldSetting.productFieldin favor of.connectedProductField. - Updated our existing
.connectedFormFields across the schema to use the new Dataloader. - Exposed
SubmitGfFormPayload.targetPageFormFieldsto help with multi-page form support. See notes below for more information.
- Added the
- 🚨 Breaking: The deprecated (int)
-
🚨 Breaking: We've improved the DX for
FormField.choicesand.inputsby narrowing down the field definitions on the implementing Types. For example, instead ofCheckboxField.choicesresolving to a genericGfFieldChoiceinterface, it now resolves directly to `CheckboxFieldChoice.Note: If your queries are checking for "impossible" interfaces, (e.g.
... on ListFieldChoiceon aCheckboxField.choicesquery), you will need to update your queries. A full list of breaking schema changes can be found below. -
We've improved the DX and handling of multi-page forms:
-
🚨 Breaking:
PageFields are now paginated to be at the bottom of the previous page, instead of at the top of the following page. H/t @SamuelHadsall.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. -
We've added
targetPageNumberandtargetPageFormFieldsto theSubmitGfFormPayloadto 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.
-
-
🚨 Breaking: We've refactored the
EntriesConnectionResolverandFormsConnectionResolverclasses to use the new API methods available as of WPGraphQL v1.26.0, leading to improved performance and reliability.Note: If you are extending these classes in your custom code, you will need to update your code to match the new method signatures.
-
🚨 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:
- Deprecated GraphQL fields:
FormsConnectionOrderbyInput.field,GfFieldWithDisableQuantitySetting.isQuantityDisabled.GfSubmittedEntry.entryId.GfForm.button,gfForm.entryId,gfForm.lastPageButton. - Deprecated hooks:
graphql_gf_form_modeled_data_experimental,graphql_gf_form_field_setting_properties,graphql_gf_form_field_value_properties. - Deprecated helper methods:
GFUtils::handle_file_upload().
- Deprecated GraphQL fields:
Breaking Schema Changes
- Field
FormField.idchanged type fromInt!toID! - Field
{$TYPE}Field.inputschanged type from[GfFieldInput]to[{$TYPE}InputProperty] - Field
{$TYPE}Field.choiceschanged type from[GfFieldChoice]to[{$TYPE}FieldChoice] - Field
values(deprecated) was removed from object typeFileUploadField - Input field
field(deprecated) was removed from input object typeFormsConnectionOrderbyInput - Field
isQuantityDisabled(deprecated) was removed from interfaceGfFieldWithDisableQuantitySetting - Field
button(deprecated) was removed from object typeGfForm - Field
formId(deprecated) was removed from object typeGfForm - Field
lastPageButton(deprecated) was removed from object typeGfForm - Field
entryId(deprecated) was removed from object typeGfSubmittedEntry
Fixes
- fix: Add missing descriptions to various GraphQL types.
- fix: Check for Submission Confirmation url before attempting to get the associated post ID.
- fix: Flush static Gravity Forms state between multiple calls to
GFUtils::submit_form(). - fix: Handle
RadioFieldsubmission values when using a custom "other" choice. H/t @Gytjarek .
Behind the Scenes
- dev: Add new
graphql_gf_activateandgraphql_gf_deactivateactions. - dev: Deprecate
FieldValues::is_field_and_entry()and remove internal usage. - dev: Remove
vendordirectory from the GitHub repository, and improve plugin initialization and autoload handling. - dev: use
WP_Filesystemto handle Signature field uploads. - chore: Declare
strict_typesin all PHP files, add type hints to all iterable types. and fix exposed type errors. - chore: Update Composer dev-dependencies and fix test compatibility with
wp-graphql-test-casev3.0.x. - chore: Update PHP interfaces and Abstract classes with better type hints.
- chore!: Bump minimum Gravity Forms version to v2.7.0.
- chore!: Bump minimum WordPress version to v6.0.0.
- chore!: Bump minimum WPGraphQL version to v1.26.0.
- tests: Add test for
GFUtils::get_last_form_page().
Full Changelog: 0.12.6.1...v0.13.0