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