Releases: AxeWP/wp-graphql-gravity-forms
v0.13.0.1
This patch release fixes compatibility with Composer-based WordPress installations, and a few minor issues introduced in the previous release.
- fix: Check if classes are loaded by a different autoloader before attempting to autoload them. H/t @cvanh
- fix: Return
wp_max_upload_size()
instead ofnull
ifGfFieldWithFileSizeSetting.maxFileSize
isnull
. H/t @Gytjarek - fix: Fix typo in Autoloader release URL.
- fix: Ensure a valid source ID exists before attempting to resolve a
connectedFormField
. - ci: Test compatibility against WP 6.6.
- ci: Replace calls to
docker-compose
withdocker compose
.
Full Changelog: v0.13.0...v0.13.0.1
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
GfForm
on theGravityformsFormAttributes.form
field. -
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.- 🚨 Breaking: The deprecated (int)
FormField.id
has been reinstated as a relay-compliantID
. If you are still usingid
as the integer database ID, you will need to update your queries to useFormField.databaseId
. - 🚨 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 theModel
's fields for better performance and reliability. - 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:- Added the
FieldError.connectedFormField
field. - Deprecated (int)
GfFieldWithProductFieldSetting.productField
in favor of.connectedProductField
. - Updated our existing
.connectedFormField
s across the schema to use the new Dataloader. - Exposed
SubmitGfFormPayload.targetPageFormFields
to 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.choices
and.inputs
by narrowing down the field definitions on the implementing Types. For example, instead ofCheckboxField.choices
resolving to a genericGfFieldChoice
interface, it now resolves directly to `CheckboxFieldChoice.Note: If your queries are checking for "impossible" interfaces, (e.g.
... on ListFieldChoice
on aCheckboxField.choices
query), 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:
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.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
targetPageNumber
andtargetPageFormFields
to theSubmitGfFormPayload
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.
-
-
🚨 Breaking: We've refactored the
EntriesConnectionResolver
andFormsConnectionResolver
classes 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.id
changed type fromInt!
toID!
- Field
{$TYPE}Field.inputs
changed type from[GfFieldInput]
to[{$TYPE}InputProperty]
- Field
{$TYPE}Field.choices
changed 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
RadioField
submission values when using a custom "other" choice. H/t @Gytjarek .
Behind the Scenes
- dev: Add new
graphql_gf_activate
andgraphql_gf_deactivate
actions. - dev: Deprecate
FieldValues::is_field_and_entry()
and remove internal usage. - dev: Remove
vendor
directory from the GitHub repository, and improve plugin initialization and autoload handling. - dev: use
WP_Filesystem
to handle Signature field uploads. - chore: Declare
strict_types
in 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-case
v3.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
v0.12.6.1
This patch release fixes the version number in the plugin header, which was incorrectly set to 0.12.5
instead of 0.12.6
.
- fix: Correct version number in plugin header.
Full Changelog: v0.12.6...0.12.6.1
v0.12.6
This minor release adds explicit support for PHP 8.2 and WordPress 6.5 - including the new Plugin Dependency header. Additionally, we've updated the Composer dependencies, and improved code quality and type safety.
What's Changed
- feat: Add plugin dependency header.
- chore: Update Composer deps and lint.
- chore: Lock WPBrowser to <3.5.0 to prevent conflicts with Codeception.
- chore: Implement strict PHPStan rules and fix resulting issues.
- chore: Add traversable type hints throughout the codebase.
- tests: Lint tests.
- ci: Update GitHub Actions to latest versions.
- ci: Test plugin compatibility with WordPress 6.5.0.
- ci: Test plugin compatibility with PHP 8.2.
Full Changelog: v0.12.5...v0.12.6
v0.12.5
This minor release fixes a bug where EmailField.inputs
were returning null
when Email Confirmation is disabled and an issue where formFields
were not being correctly filtered by their where
args.
We've also updated the Composer dependencies, did some code linting, and tested compatibility against WordPress 6.4.x.
What's Changed
- 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.
- chore: Update
yahnis-elsts/plugin-update-checker
to v5.3. - chore: Update
axepress/wp-graphql-cs
to v2.0.0-beta.2 and fix resulting issues. - chore: Update Composer dev deps.
- ci: Test compatibility with WordPress 6.4.x
- docs: Add docs on troubleshooting i18n issues. H/t @Dev-Ditrict-Web.
Full Changelog: v0.12.4...v0.12.5
v0.12.4
This minor release fixes a bug where updating the plugin via the WordPress backend would fail due to changes to GitHub's API.
Note: Users relying on WordPress's built-in plugin update mechanism will need to update manually to this version by downloading the release zip.
What's Changed
- fix: Fix installation errors when upgrading plugin via the WordPress backend. H/t @Shaderpixel.
- chore: Update
yahnis-elsts/plugin-update-checker
to v5.2. - ci: Include top-level plugin folder in release zip.
Full Changelog: v0.12.3...v0.12.4
v0.12.3
This minor release fixes a few bugs when resolving GfEntry
data, and addresses some code smells from the updated WPGraphQL Coding Standards. We're also now testing the plugin against WordPress 6.3 and PHP 8.1.
What's Changed
- fix: Check if entries exist before resolving the connection
count
. - fix: Improve type checks when calculating the
QuizResults
data. - fix: Pass the entry array to the
QuizResults
resolver. - chore: Fix Composer PHP version constraints and rebuild lockfile. Thanks @szepeviktor!
- chore: Update WPGraphQL Coding Standards to 2.0.0-beta.1 and fix resulting issues.
- chore: Update Composer dev-deps.
- chore: Update links to repo and README.
- tests: Set
WPLoader.loadOnly
to true for acceptance suite. Thanks @lucatume! - ci: Fix GitHub Action workflows by locking MariaDB version to v10.
- ci: Test against WordPress 6.3 and PHP 8.1
Full Changelog: v0.12.2...v0.12.3
v0.12.2
This minor release expands the ability to use database and global IDs interchangeably in more connections. We also now prime the GFFormsLoader
dataloader, reducing the number of database queries and improving performance.
We've also implemented the new WPGraphQL Coding Standards ruleset for PHP_CodeSniffer
. While many of the (over 1000+) addressed sniffs are cosmetic, numerous smells regarding performance, type safety, sanitization, and 3rd-party interoperability have been fixed as well.
What's changed
- dev: Refactor database ID resolution when the GraphQL
ID
type is indeterminate. Note: The following input args now work with both database and global IDs:GfEntriesConnectionWhereArgs.formIds
,GfFormsConnectionwhereArgs.formIds
. - dev: Remove usage of deprecated
WPGraphQL\Data\DataSource::resolve_post_object()
method. - dev: Prime the GfForm dataloader when querying form connections, to prevent unnecessary database queries.
- chore: Implement
axepress/wp-graphql-cs
PHP_Codesniffer ruleset, and fix all resulting issues. - docs: Add missing documentation regarding using
productValues
input when submitting forms.
Full Changelog: v0.12.1...v0.12.2
v0.12.1 - Bugfix
This minor release fixes an issue where certain complex Field Input and Field Choice types would try to implement a non-existent parent interface, causing GraphQL debug messages to be returned in the response.
What's Changed
- fix: Use local store for
FieldInputRegistry
andFieldChoiceRegistry
to prevent the registration of duplicate/nonexistent types. - chore: Update Composer dev deps.
- test: Ensure no
extensions['debug']
messages are returned when querying FormFields. - ci: Test against WordPress 6.2
- ci: Ignore
graphql-schema-linter
error forFormFieldConnection.pageInfo
missing a description. This will be reverted once FormFieldConnection is refactored to be a Relay-compatible.
Full Changelog: v0.12.0...v0.12.1
v0.12.0 - Form Field Interfaces and Pricing Fields
This major release refactors the way Gravity Forms fields are registered in GraphQL, by using GraphQL interfaces derived from the Forms Field Settings to register the fields, choices, and inputs tp the type. This allows for more flexibility in how fields are registered and consumed, and for DRYer GraphQL queries and frontend components.
This release also adds explicit support for Pricing Fields. Specifically, we've added support for the Option
, Product
, Quantity
, Shipping
, and Total
fields, and the orderSummary
field on GfEntry
.
Lastly, we've exposed the connectedChoice
and connectedInput
fields on CheckboxFieldValue
objects, added some additional test coverage, and squashed a few bugs along the way.
Note: The minimum version of WPGraphQL has been bumped to v1.9.0.
What's New
- 🚨 Breaking: We've refactored the way Gravity Forms fields are registered in GraphQL, by using GraphQL interfaces derived from the Gravity Forms Field Settings. Note: This is a breaking change, and will require you to update your GraphQL queries for
formField.choices
andformField.inputs
to use the newFormFieldChoice
andFormFieldInput
interfaces, respectively. - We've added explicit support for the
Option
,Product
,Quantity
,Shipping
, andTotal
Gravity Forms fields. - We've added the new
orderSummary
field toGfEntry
objects, which contains all the order details for the form submission. - We've exposed the
connectedChoice
andconnectedInput
fields toCheckboxFieldValue
objects, to make it easier to access specific values of the selected choices and inputs without hacky workarounds. - We've deprecated the
FormField.id
field in favor ofFormField.databaseId
, which is more consistent with WPGraphQL's naming conventions. Note:FormField.id
will change its type to a global (Relay) ID in an upcoming release.
🚨 Breaking Schema Changes
- Field
AddressField.defaultProvince
changed type from String toAddressFieldProvinceEnum
. - Field
AddressField.defaultState
changed type from String toAddressFieldProvinceEnum
. - All
{FieldType}.inputs
fields changed type from[AddressInputProperty]
to[GfFieldInput]
. - Field
{FieldType}.choices
changed type from[ChainedSelectFieldChoice]
to[GfFieldChoice]
. - Enum value
SUBMIT
was removed from enumFormFieldTypeEnum
. PostCategoryFieldChoice
kind changed fromObjectTypeDefinition
toInterfaceTypeDefinition
.- Type
PostCategoryInputProperty
was removed. - Type
PostCustomInputProperty
was removed. - Type
PostTagsInputProperty
was removed. QuizFieldChoice
kind changed fromObjectTypeDefinition
to InterfaceTypeDefinition.- Type
QuizInputProperty
was removed. - Type
SubmitField
was removed.
Fixes
- fix: Ensure latest mutation input data is used to prepare the field values on update mutations.
- fix: Check for falsy
personalData
when resolving the form model.
Misc
- feat: Deprecate
FormsConnectionOrderbyInput.field
in favor ofFormsConnectionOrderbyInput.column
Behind the Scenes
- feat!: Update minimum required WPGraphQL version to v1.9.0.
- dev!: Move
TypeRegistry
classes toWPGraphQL\GF\Registry
namespace. - dev!: Register each GraphQL type on its own
add_action()
call. - dev!: Remove nullable
$type_registry
param fromRegistrable::register()
interface method. - dev!: Remove the
$type_registry
param from thegraphql_gf_after_register_types
andgraphql_gf_before_register_types
actions. - dev!: Remove the
PropertyMapper
,ChoiceMapper
,InputMapper
, andFieldProperties
PHP classes in favor of theFormFieldRegistry
,FieldInputRegistry
andFieldChoiceRegistry
classes. - dev!: Check if plugin dependences meet the minimum version requirements.
- dev: Add following actions:
graphql_gf_after_register_form_field
,graphql_gf_after_register_form_field_object
. - dev: Add the following filters:
graphql_gf_form_field_settings_with_inputs
graphql_gf_form_field_settings_with_choices
graphql_gf_form_field_setting_choice_fields
,graphql_gf_form_field_setting_input_fields
,graphql_gf_registered_form_field_setting_classes
,graphql_gf_registered_form_field_setting_choice_classes
,graphql_gf_registered_form_field_setting_input_classes
. - dev: Deprecate the
graphql_gf_form_field_setting_properties
filter in favor ofgraphql_gf_form_field_setting_fields
. - dev: Deprecate the
graphql_gf_form_field_value_properties
filter in favor ofgraphql_gf_form_field_value_fields
. - chore: Refactor
FormsConnectionResolver
to use newAbstractConnectionResolver
methods. - chore: Add
automattic/vipcs
Code Standard ruleset. - ci: Update GitHub Action versions used in workflows to latest.
- ci: Update Node version to 16+.
- ci: Run actions on organization repository.
- ci: Add coverage to Code Climate.
- ci: Set config to skip GF Setup screen.
- tests: Rename FormFieldTestCase test methods for specificity.
- tests: Format and harden.
- tests: Add tests for
submitGfForm
mutation. - docs: replace
formId
withid
insubmitGfForm
examples. Props: @mosesintech
New Contributors
- @szepeviktor made their first contribution in #330
- @mosesintech made their first contribution in #341
Full Changelog: v0.11.11...v0.12.0