Repository navigation
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.choicesandformField.inputsto use the newFormFieldChoiceandFormFieldInputinterfaces, respectively. - We've added explicit support for the
Option,Product,Quantity,Shipping, andTotalGravity Forms fields. - We've added the new
orderSummaryfield toGfEntryobjects, which contains all the order details for the form submission. - We've exposed the
connectedChoiceandconnectedInputfields toCheckboxFieldValueobjects, to make it easier to access specific values of the selected choices and inputs without hacky workarounds. - We've deprecated the
FormField.idfield in favor ofFormField.databaseId, which is more consistent with WPGraphQL's naming conventions. Note:FormField.idwill change its type to a global (Relay) ID in an upcoming release.
🚨 Breaking Schema Changes
- Field
AddressField.defaultProvincechanged type from String toAddressFieldProvinceEnum. - Field
AddressField.defaultStatechanged type from String toAddressFieldProvinceEnum. - All
{FieldType}.inputsfields changed type from[AddressInputProperty]to[GfFieldInput]. - Field
{FieldType}.choiceschanged type from[ChainedSelectFieldChoice]to[GfFieldChoice]. - Enum value
SUBMITwas removed from enumFormFieldTypeEnum. PostCategoryFieldChoicekind changed fromObjectTypeDefinitiontoInterfaceTypeDefinition.- Type
PostCategoryInputPropertywas removed. - Type
PostCustomInputPropertywas removed. - Type
PostTagsInputPropertywas removed. QuizFieldChoicekind changed fromObjectTypeDefinitionto InterfaceTypeDefinition.- Type
QuizInputPropertywas removed. - Type
SubmitFieldwas removed.
Fixes
- fix: Ensure latest mutation input data is used to prepare the field values on update mutations.
- fix: Check for falsy
personalDatawhen resolving the form model.
Misc
- feat: Deprecate
FormsConnectionOrderbyInput.fieldin favor ofFormsConnectionOrderbyInput.column
Behind the Scenes
- feat!: Update minimum required WPGraphQL version to v1.9.0.
- dev!: Move
TypeRegistryclasses toWPGraphQL\GF\Registrynamespace. - dev!: Register each GraphQL type on its own
add_action()call. - dev!: Remove nullable
$type_registryparam fromRegistrable::register()interface method. - dev!: Remove the
$type_registryparam from thegraphql_gf_after_register_typesandgraphql_gf_before_register_typesactions. - dev!: Remove the
PropertyMapper,ChoiceMapper,InputMapper, andFieldPropertiesPHP classes in favor of theFormFieldRegistry,FieldInputRegistryandFieldChoiceRegistryclasses. - 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_propertiesfilter in favor ofgraphql_gf_form_field_setting_fields. - dev: Deprecate the
graphql_gf_form_field_value_propertiesfilter in favor ofgraphql_gf_form_field_value_fields. - chore: Refactor
FormsConnectionResolverto use newAbstractConnectionResolvermethods. - chore: Add
automattic/vipcsCode 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
submitGfFormmutation. - docs: replace
formIdwithidinsubmitGfFormexamples. 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