Skip to content

v0.10.0 - Major Plugin & Schema Refactor

Choose a tag to compare

@justlevine justlevine released this 01 Jan 23:24
· 289 commits to develop since this release
dcbed68

⚠️ This release contains multiple breaking changes.

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_FIELDS PHP constant. Learn more.
    Note: As a result of this change, the available fields on by the FormField interface 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 gravityForms in the schema with the gf shorthand for improved dx. gravityFormsForms are now gfForms, updateGravityFormsEntry is now updateGfEntry, etc.
  • 🚨 Breaking: Gravity Forms entries and draft entries now inherit the gfEntry interface, and use the GfSubmittedEntry and GfDraftEntry object 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 Post object.
  • feat: FormField connections can now be filtered by the form pageNumber.
  • feat!: change dateCreated and dateUpdated to be in the site's timezone, and added the dateCreatedGmt and dateUpdatedGmt for 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 (formerly sort) direction for Forms is now DESC to 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/Extensions namespace.
  • chore: Update Composer deps.
  • chore: Update PHPStan to v1.x and lint.
  • docs: Updated existing docs to reflect schema changes, and added Recipes that 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, and Signature fields, as well as for updateGfEntry and updateGfDraftEntry mutations.

Important Schema Changes:

Renamed

  • Field allowsPrepopulate was renamed to canPrepopulate.
  • Field chainedSelectsHideInactive was renamed to shouldHideInactiveChoices.
  • Field copyValuesOptionField was renamed to copyValuesOptionFieldId.
  • Field disableAutoformat was renamed to isAutoformatted.
  • Field disableMargins was renamed to hasMargins.
  • Field displayAlt was renamed to hasAlt.
  • Field displayCaption was renamed to hasCaption.
  • Field displayDescription was renamed to hasDescription.
  • Field displayProgressbarOnConfirmation was renamed to hasProgressbarOnConfirmation.
  • Field displayTitle was renamed to hasTitle.
  • Field emailConfirmEnabled was renamed to hasEmailConfirmation.
  • Field enableAttachments was renamed to shouldSendAttachments.
  • Field enableAutocomplete was renamed to hasAutocomplete.
  • Field enableCalculation was renamed to isCalculation.
  • Field enableChoiceValue was renamed to hasChoiceValue.
  • Field enableColumns was renamed to hasColumns.
  • Field enableCopyValuesOption was renamed to shouldCopyValuesOption.
  • Field enableEnhancedUI was renamed to hasEnhancedUI.
  • Field enableOtherChoice was renamed to hasOtherChoice.
  • Field enablePasswordInput was renamed to isPasswordInput.
  • Field enablePrice was renamed to hasPrice.
  • Field enableSelectAll was renamed to hasSelectAll.
  • Field FormPagination.pages was renamed to pageNames.
  • Field gravityFormsEntries was renamed to gfEntries. It now returns the gfEntry interface.
  • Field gravityFormsEntry was removed in favor of the gfEntry Interface.
  • Field isPass was renamed to isPassingScore.
  • Field multipleFiles was renamed to canAcceptMultipleFiles.
  • Field noDuplicates was renamed to shouldAllowDuplicates.
  • Field passwordStrengthEnabled was renamed to hasPasswordStrengthIndicator.
  • Field postFeaturedImage was renamed to isFeaturedImage.
  • Field useRichTextEditor was renamed to hasRichTextEditor.
  • Fields gravityFormsForm was renamed to gfForm.
  • Fields gravityFormsForms was renamed to gfForms.
  • Mutation deleteGravityFormsDraftEntry and its associated Input and Payload objects were renamed to deleteGfDraftEntry.
  • Mutation deleteGravityFormsEntry and its associated Input and Payload objects were renamed to deleteGfEntry and their fields changed.
  • Mutation submitGravityFormsDraftEntry and its associated Input and Payload objects were renamed to submitGfDraftEntry.
  • Mutation submitGravityFormsForm and its associated Input and Payload objects were renamed to submitGfForm and their fields changed.
  • Mutation updateGravityFormsDraftEntry and its associated Input and Payload objects were renamed to updateGfDraftEntry.
  • Mutation updateGravityFormsEntry and its associated Input and Payload objects were renamed to updateGfEntry.
  • Object AddressInput was renamed to AddressFieldInput.
  • Object AddressTypeEnum was renamed to AddressFieldTypeEnum.
  • Object Button was renamed to FormButton.
  • Object ButtonType was renamed to Enum.
  • Object CalendarIconTypeEnum was renamed to FormFieldCalendarIconTypeEnum.
  • Object CalendarIconTypeEnum was renamed to FormFieldCalendarIconTypeEnum.
  • Object CaptchaThemeEnum was renamed to CaptchaFieldThemeEnum.
  • Object CaptchaTypeEnum was renamed to CaptchaFieldTypeEnum.
  • Object ChainedSelectInput was renamed to ChainedSelectFieldInput.
  • Object ChainedSelectsAlignmentEnum was renamed to ChainedSelectFieldAlignmentEnum.
  • Object CheckboxInput was renamed to CheckboxFieldInput.
  • Object ChoiceProperty was replaced with form-field specific {FieldType}FieldChoice objects.
  • Object ConfirmationTypeEnum was renamed to FormConfirmationTypeEnum.
  • Object ConfirmationTypeEnum was renamed to FormConfirmationTypeEnum.
  • Object DateTypeEnum was renamed to DateFieldTypeEnum.
  • Object DescriptionPlacementPropertyEnum was renamed to FormFieldDescriptionPlacementEnum.
  • Object EmailInput was renamed to EmailFieldInput.
  • Object FieldFiltersOperatorInputEnum was renamed to FieldFiltersOperatorEnum.
  • Object FieldValuesInput was renamed to FormFieldValuesInput.
  • Object FormFieldsEnum was renamed to FormFieldTypeEnum.
  • Object GravityFormsForm and its associated connection object Types were renamed to GfForm.
  • Object LabelPlacementPropertyEnum was renamed to FormFieldLabelPlacementEnum and FormLabelPlacementEnum, depending on the context.
  • Object LastPageButton was renamed to FormLastPageButton.
  • Object MinPasswordStrengthEnum was renamed to PasswordFieldMinStrengthEnum.
  • Object NameInput was renamed to NameFieldInput.
  • Object NotificationToTypeEnum was renamed to FormNotificationToTypeEnum.
  • Object PageProgressStyleEnum was renamed to FormPageProgressStyleEnum.
  • Object PageProgressTypeEnum was renamed to FormPageProgressTypeEnum.
  • Object PostImageValueProperty was renamed to ImageFieldValue.
  • Object QuizGrades was renamed to FormQuizGrades.
  • Object QuizGradingTypeEnum was renamed to QuizFieldGradingTypeEnum.
  • Object QuizSettings was renamed to FormQuiz.
  • Object RequiredIndicatorEnum was renamed to FormFieldRequiredIndicatorEnum.
  • Object RuleOperatorEnum was renamed to FormRuleOperatorEnum.
  • Object SaveAndContinue was renamed to FormSaveAndContinue.
  • Object SignatureBorderStyleEnum was renamed to SignatureFieldBorderStyleEnum.
  • Object SignatureBorderWidthEnum was renamed to SignatureFieldBorderWidthEnum.
  • Object SizePropertyEnum was renamed to FormFieldSizeEnum.
  • Object VisibilityPropertyEnum was renamed to FormFieldVisibilityEnum.

Removed

  • Field adminLabel was removed from object types: CaptchaField, HiddenField, HtmlField, PageField, sectionField.
  • Field adminOnly was removed from all FormFields in favor of visibility.
  • Field autocompleteAttribute was removed from object type EmailField
  • Field conditionalLogic was removed from object type HiddenField
  • Field copyValuesOptionDefault was removed from object type AddressField, in favor of shoudCopyValuesOption
  • Field cssClass was removed from object type HiddenField
  • Field cssClassList (deprecated) was removed from all FormField objects.
  • Field defaultValue was removed from object type EmailField
  • Field formId was removed from individual FormField objects.
  • Field inputName was removed from object types: ConsentField, EmailField, TimeField, FileUploadField, HtmlField, PostImageField.
  • Field isHidden (deprecated) was removed from object type ChainedSelectInputProperty, DateInputProperty, EmailInputProperty,
  • Field isRequired was removed from object type HiddenField
  • Field key (deprecated) was removed from object type DateInputProperty, EmailInputProperty
  • Field label (deprecated) was removed from object type PageField
  • Field name (deprecated) was removed from object type DateInputProperty
  • Field nameFormat was removed from object type NameField
  • Field placeholder was removed from object type PasswordField
  • Field quizType was removed from interface QuizField, in favor of inputType.
  • Field size was 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 type ListFieldValue
  • Object EntriesSortingInput was removed, in favor of EntriesConnectionOrderbyInput.
  • Object FormsSortingInput was removed, in favor of FormsConnectionOrderbyInput.
  • The following items associated with the deprecated method of form submissions have been removed, including RootQuery.createGravityFormsDraftEntry, RootQuery.updateDraftEntry{FieldType}FieldValue, and their related Input and Payload objects. Most {FieldType}FieldValue types were removed, but AddressFieldValue, CheckboxFieldValue, ListFieldValue, NameFieldValue, TimeFieldValue have been repurposed.
  • Type CheckboxInputValue was removed, in favor of CheckboxFieldInput
  • Type EntryForm was removed, in favor of returning the GfForm directly.
  • Type EntryUser was removed, in favor of returning the User directly.
  • Type GravityFormsEntry was removed, in favor of the GfEntry interface and GfSubmittedEntry object type. The associated Connection object types have been renamed as well.
  • Type ListInputValue was removed, in favor of ListFieldValue
  • Type SortingInputEnum was removed, in favor of the OrderEnum.

Changed Type

  • Field AddressField.country changed type from String to AddressFieldCountryEnum
  • Field AddressField.defaultCountry changed type from String to AddressFieldCountryEnum
  • Field allowedExtensions changed type from String to [String]
  • Field subLabelPlacement changed type from String to FormFieldSubLabelPlacement on all FormField objects.
  • Field TimeFieldValue.amPm changed type from String to AmPmEnum
  • Field type changed type from String! to FormFieldTypeEnum! on all FormField objects.
  • Input field idType changed type from IdTypeEnum to the Enum relevant to the object type (e.g. FormIdTypeEnum ).
  • Objects PostCategoryField, PostCustomField, PostTagsField, QuizField were changed to a GraphQL Interface, and their possible Form field types added as objects.
  • The generic ChoiceProperty object was replaced with form-field-specific objects {FieldType}ChoiceProperty
  • The generic InputProperty object was replaced with form-field-specific objects {FieldType}InputProperty

Additions

  • Field captchaBadgePosition was added to object type CaptchaField
  • Field consentValue was added to object type ConsentField
  • Field displayOnly was added to interface FormField.
  • Field hasInputMask was added to object type TextField.
  • Field hasPasswordVisibilityToggle was added to object type PasswordField
  • Field inputMaskValue was added to object type TextField
  • Field isOtherChoice was added to object type QuizChoiceProperty
  • Field isSelected was added to object type QuizChoiceProperty
  • Field labelPlacement was added to the relevant FormField object types.
  • Field text was added to object type CheckboxFieldValue
  • Field value was added to every relevant FormField object type, in addition to their special {FieldType}Value.
  • Field visibility was moved to interface FormField
  • The following fields are no longer deprecated: AddressField.inputName, CaptchaField.visibility, DateInputProperty.autocompleteAttribute, HiddenField.visibility, HtmlField.visibility, NameField.inputName, PageField.visibility, PasswordField.visibility.
  • Type ListFieldInput was added
  • Type NodeWithForm was added
  • Type PostFormatTypeEnum was added.
  • Types FormEntryLimits, FormLogin, FormPostCreation, FormSchedule were added to GfForm. Relevant fields from gfForm have been moved.