v0.10.0 - Major Plugin & Schema Refactor
This major release is a refactor the entire plugin in preparation for v1.0. GraphQL fields and types have been renamed and reorganized, the codebase is following ecosystem best practices, WP Actions and Filters have been changed to make it easier than ever, and dozens of performance enhancements have been made under the hood.
We expect this release to be the last major breaking release before v1.0. While we can't make any promises, we don't expect to make any more breaking changes to the GraphQL schema beyond those necessary for bug fixes.
What's new
- 🚨 Breaking: Gravity Forms form fields are now autoregistered to the GraphQL schema using their registered GF field settings. That means all form fields (including custom fields) are implictly supported. For development purposes, certain core fields are hidden behind the
WPGRAPHQL_GF_EXPERIMENTAL_FIELDSPHP constant. Learn more.
Note: As a result of this change, the available fields on by theFormFieldinterface and on individual Form field objects have changed. - 🚨 Breaking: Complex Gravity Forms form fields now inherit the properties of their parent
$inputTypes. Form fields that can resolve to multiple types are now registed as GraphQL Interfaces (e.g.PostCategoryField), with their child types as GraphQL objects ( e.g.PostCategoryCheckboxField). - 🚨 Breaking: GraphQL objects and fields have been renamed to be self documenting and prevent naming conflicts. Many fields have also been grouped into new GraphQL objects to improve DX and harden against future breaking schema changes. This is equally true for mutation inputs and payloads.
- 🚨 Breaking: We've replaced the use of
gravityFormsin the schema with thegfshorthand for improved dx.gravityFormsFormsare nowgfForms,updateGravityFormsEntryis nowupdateGfEntry, etc. - 🚨 Breaking: Gravity Forms entries and draft entries now inherit the
gfEntryinterface, and use theGfSubmittedEntryandGfDraftEntryobject types. - 🚨 Breaking: We've renamed and audited the use of all WordPress filter hooks to ensure they're actually helpful. We're using them internally to support plugin extensions, and have provided several docs on how to use them.
- We've added support for WPGatsby Action Monitors.
Behind the scenes
- 🚨 Breaking: The entire PHP codebase has been refactored to follow WPGraphQL ecosystem best practices. The namespaces, folder structure, and many file names have changed.
- 🚨 Breaking: We've removed all previously deprecated code. This includes the DraftEntryUpdater mutations, numerous GraphQL fields, and several PHP classes and interfaces.
- 🚨 Breaking: We're now properly using GraphQL data loaders, models, and connection loaders, bringing with them significant performance boosts. As a result Global Ids are now prefixed with the data loader name, instead of the GraphQL object type.
- We've stopped unnecessarily double-sanitizing and validating input values that are sanitized/validated by Gravity Forms.
Misc
- feat: add connection from Entries to their generated
Postobject. - feat: FormField connections can now be filtered by the form
pageNumber. - feat!: change
dateCreatedanddateUpdatedto be in the site's timezone, and added thedateCreatedGmtanddateUpdatedGmtfor GMT time. - fix: correctly fallback to default upload directory wen using
GFUtils::handle_file_upload(). - fix: don't double sanitize/validate input values that are handled natively by GF.
- fix: prevent existing draft entry properties from being overwritten unnecessarily on update mutations.
- fix!: The default
orderby(formerlysort) direction for Forms is nowDESCto match expected behavior. - dev!: change arguments for
GFUtils::get_resume_url()to allow for empty sourceUrls. - chore: move functionality for GF Signature, Quiz, and Chained Selects to the
WPGraphQL/GF/Extensionsnamespace. - chore: Update Composer deps.
- chore: Update PHPStan to v1.x and lint.
- docs: Updated existing docs to reflect schema changes, and added
Recipesthat explain in detail how to extend the plugin. - tests: Refactored FormField tests to use GF field settings to derive the expected GraphQL response.
- tests: Add tests for
FileUpload,PostCategory,PostImage,PostTags, andSignaturefields, as well as forupdateGfEntryandupdateGfDraftEntrymutations.
Important Schema Changes:
Renamed
- Field
allowsPrepopulatewas renamed tocanPrepopulate. - Field
chainedSelectsHideInactivewas renamed toshouldHideInactiveChoices. - Field
copyValuesOptionFieldwas renamed tocopyValuesOptionFieldId. - Field
disableAutoformatwas renamed toisAutoformatted. - Field
disableMarginswas renamed tohasMargins. - Field
displayAltwas renamed tohasAlt. - Field
displayCaptionwas renamed tohasCaption. - Field
displayDescriptionwas renamed tohasDescription. - Field
displayProgressbarOnConfirmationwas renamed tohasProgressbarOnConfirmation. - Field
displayTitlewas renamed tohasTitle. - Field
emailConfirmEnabledwas renamed tohasEmailConfirmation. - Field
enableAttachmentswas renamed toshouldSendAttachments. - Field
enableAutocompletewas renamed tohasAutocomplete. - Field
enableCalculationwas renamed toisCalculation. - Field
enableChoiceValuewas renamed tohasChoiceValue. - Field
enableColumnswas renamed tohasColumns. - Field
enableCopyValuesOptionwas renamed toshouldCopyValuesOption. - Field
enableEnhancedUIwas renamed tohasEnhancedUI. - Field
enableOtherChoicewas renamed tohasOtherChoice. - Field
enablePasswordInputwas renamed toisPasswordInput. - Field
enablePricewas renamed tohasPrice. - Field
enableSelectAllwas renamed tohasSelectAll. - Field
FormPagination.pageswas renamed topageNames. - Field
gravityFormsEntrieswas renamed togfEntries. It now returns thegfEntryinterface. - Field
gravityFormsEntrywas removed in favor of thegfEntryInterface. - Field
isPasswas renamed toisPassingScore. - Field
multipleFileswas renamed tocanAcceptMultipleFiles. - Field
noDuplicateswas renamed toshouldAllowDuplicates. - Field
passwordStrengthEnabledwas renamed tohasPasswordStrengthIndicator. - Field
postFeaturedImagewas renamed toisFeaturedImage. - Field
useRichTextEditorwas renamed tohasRichTextEditor. - Fields
gravityFormsFormwas renamed togfForm. - Fields
gravityFormsFormswas renamed togfForms. - Mutation
deleteGravityFormsDraftEntryand its associatedInputandPayloadobjects were renamed todeleteGfDraftEntry. - Mutation
deleteGravityFormsEntryand its associatedInputandPayloadobjects were renamed todeleteGfEntryand their fields changed. - Mutation
submitGravityFormsDraftEntryand its associatedInputandPayloadobjects were renamed tosubmitGfDraftEntry. - Mutation
submitGravityFormsFormand its associatedInputandPayloadobjects were renamed tosubmitGfFormand their fields changed. - Mutation
updateGravityFormsDraftEntryand its associatedInputandPayloadobjects were renamed toupdateGfDraftEntry. - Mutation
updateGravityFormsEntryand its associatedInputandPayloadobjects were renamed toupdateGfEntry. - Object
AddressInputwas renamed toAddressFieldInput. - Object
AddressTypeEnumwas renamed toAddressFieldTypeEnum. - Object
Buttonwas renamed toFormButton. - Object
ButtonTypewas renamed toEnum. - Object
CalendarIconTypeEnumwas renamed toFormFieldCalendarIconTypeEnum. - Object
CalendarIconTypeEnumwas renamed toFormFieldCalendarIconTypeEnum. - Object
CaptchaThemeEnumwas renamed toCaptchaFieldThemeEnum. - Object
CaptchaTypeEnumwas renamed toCaptchaFieldTypeEnum. - Object
ChainedSelectInputwas renamed toChainedSelectFieldInput. - Object
ChainedSelectsAlignmentEnumwas renamed toChainedSelectFieldAlignmentEnum. - Object
CheckboxInputwas renamed toCheckboxFieldInput. - Object
ChoicePropertywas replaced with form-field specific{FieldType}FieldChoiceobjects. - Object
ConfirmationTypeEnumwas renamed toFormConfirmationTypeEnum. - Object
ConfirmationTypeEnumwas renamed toFormConfirmationTypeEnum. - Object
DateTypeEnumwas renamed toDateFieldTypeEnum. - Object
DescriptionPlacementPropertyEnumwas renamed toFormFieldDescriptionPlacementEnum. - Object
EmailInputwas renamed toEmailFieldInput. - Object
FieldFiltersOperatorInputEnumwas renamed toFieldFiltersOperatorEnum. - Object
FieldValuesInputwas renamed toFormFieldValuesInput. - Object
FormFieldsEnumwas renamed toFormFieldTypeEnum. - Object
GravityFormsFormand its associated connection object Types were renamed toGfForm. - Object
LabelPlacementPropertyEnumwas renamed toFormFieldLabelPlacementEnumandFormLabelPlacementEnum, depending on the context. - Object
LastPageButtonwas renamed toFormLastPageButton. - Object
MinPasswordStrengthEnumwas renamed toPasswordFieldMinStrengthEnum. - Object
NameInputwas renamed toNameFieldInput. - Object
NotificationToTypeEnumwas renamed toFormNotificationToTypeEnum. - Object
PageProgressStyleEnumwas renamed toFormPageProgressStyleEnum. - Object
PageProgressTypeEnumwas renamed toFormPageProgressTypeEnum. - Object
PostImageValuePropertywas renamed toImageFieldValue. - Object
QuizGradeswas renamed toFormQuizGrades. - Object
QuizGradingTypeEnumwas renamed toQuizFieldGradingTypeEnum. - Object
QuizSettingswas renamed toFormQuiz. - Object
RequiredIndicatorEnumwas renamed toFormFieldRequiredIndicatorEnum. - Object
RuleOperatorEnumwas renamed toFormRuleOperatorEnum. - Object
SaveAndContinuewas renamed toFormSaveAndContinue. - Object
SignatureBorderStyleEnumwas renamed toSignatureFieldBorderStyleEnum. - Object
SignatureBorderWidthEnumwas renamed toSignatureFieldBorderWidthEnum. - Object
SizePropertyEnumwas renamed toFormFieldSizeEnum. - Object
VisibilityPropertyEnumwas renamed toFormFieldVisibilityEnum.
Removed
- Field
adminLabelwas removed from object types:CaptchaField,HiddenField,HtmlField,PageField,sectionField. - Field
adminOnlywas removed from all FormFields in favor ofvisibility. - Field
autocompleteAttributewas removed from object typeEmailField - Field
conditionalLogicwas removed from object typeHiddenField - Field
copyValuesOptionDefaultwas removed from object type AddressField, in favor ofshoudCopyValuesOption - Field
cssClasswas removed from object typeHiddenField - Field
cssClassList(deprecated) was removed from allFormFieldobjects. - Field
defaultValuewas removed from object typeEmailField - Field
formIdwas removed from individualFormFieldobjects. - Field
inputNamewas removed from object types:ConsentField,EmailField,TimeField,FileUploadField,HtmlField,PostImageField. - Field
isHidden(deprecated) was removed from object typeChainedSelectInputProperty,DateInputProperty,EmailInputProperty, - Field
isRequiredwas removed from object typeHiddenField - Field
key(deprecated) was removed from object typeDateInputProperty,EmailInputProperty - Field
label(deprecated) was removed from object typePageField - Field
name(deprecated) was removed from object typeDateInputProperty - Field
nameFormatwas removed from object typeNameField - Field
placeholderwas removed from object typePasswordField - Field
quizTypewas removed from interfaceQuizField, in favor ofinputType. - Field
sizewas removed from object types:AddressField,CaptchaField,ChainedSelectField,CheckboxField,DateField,FileUploadField,HiddenField,HtmlField,ListField,NameField,PageField,RadioField,SectionField,SignatureField,TimeField, PostImageField - Field
value(deprecated) was removed from object typeListFieldValue - Object
EntriesSortingInputwas removed, in favor ofEntriesConnectionOrderbyInput. - Object
FormsSortingInputwas removed, in favor ofFormsConnectionOrderbyInput. - The following items associated with the deprecated method of form submissions have been removed, including
RootQuery.createGravityFormsDraftEntry,RootQuery.updateDraftEntry{FieldType}FieldValue, and their relatedInputandPayloadobjects. Most{FieldType}FieldValuetypes were removed, butAddressFieldValue,CheckboxFieldValue,ListFieldValue,NameFieldValue,TimeFieldValuehave been repurposed. - Type
CheckboxInputValuewas removed, in favor ofCheckboxFieldInput - Type
EntryFormwas removed, in favor of returning theGfFormdirectly. - Type
EntryUserwas removed, in favor of returning theUserdirectly. - Type
GravityFormsEntrywas removed, in favor of theGfEntryinterface andGfSubmittedEntryobject type. The associated Connection object types have been renamed as well. - Type
ListInputValuewas removed, in favor ofListFieldValue - Type
SortingInputEnumwas removed, in favor of theOrderEnum.
Changed Type
- Field
AddressField.countrychanged type fromStringtoAddressFieldCountryEnum - Field
AddressField.defaultCountrychanged type fromStringtoAddressFieldCountryEnum - Field
allowedExtensionschanged type fromStringto[String] - Field
subLabelPlacementchanged type fromStringtoFormFieldSubLabelPlacementon allFormFieldobjects. - Field
TimeFieldValue.amPmchanged type fromStringtoAmPmEnum - Field
typechanged type fromString!toFormFieldTypeEnum!on allFormFieldobjects. - Input field
idTypechanged type fromIdTypeEnumto the Enum relevant to the object type (e.g.FormIdTypeEnum). - Objects
PostCategoryField,PostCustomField,PostTagsField,QuizFieldwere changed to a GraphQLInterface, and their possible Form field types added as objects. - The generic
ChoicePropertyobject was replaced with form-field-specific objects{FieldType}ChoiceProperty - The generic
InputPropertyobject was replaced with form-field-specific objects{FieldType}InputProperty
Additions
- Field
captchaBadgePositionwas added to object typeCaptchaField - Field
consentValuewas added to object typeConsentField - Field
displayOnlywas added to interfaceFormField. - Field
hasInputMaskwas added to object typeTextField. - Field
hasPasswordVisibilityTogglewas added to object type PasswordField - Field
inputMaskValuewas added to object type TextField - Field
isOtherChoicewas added to object type QuizChoiceProperty - Field
isSelectedwas added to object type QuizChoiceProperty - Field
labelPlacementwas added to the relevantFormFieldobject types. - Field
textwas added to object typeCheckboxFieldValue - Field
valuewas added to every relevantFormFieldobject type, in addition to their special{FieldType}Value. - Field
visibilitywas moved to interfaceFormField - The following fields are no longer deprecated:
AddressField.inputName,CaptchaField.visibility,DateInputProperty.autocompleteAttribute,HiddenField.visibility,HtmlField.visibility,NameField.inputName,PageField.visibility,PasswordField.visibility. - Type
ListFieldInputwas added - Type
NodeWithFormwas added - Type
PostFormatTypeEnumwas added. - Types
FormEntryLimits,FormLogin,FormPostCreation,FormSchedulewere added toGfForm. Relevant fields fromgfFormhave been moved.