Skip to content

v0.4.0 - A Simpler Form Submission Flow!

Choose a tag to compare

@justlevine justlevine released this 06 Apr 01:31
· 393 commits to develop since this release
1a1a3cd

** ⚠️ This release contains multiple breaking changes. **

This release adds the submitGravityFormsForm mutation that submit forms without needing to use the existing createGravityFormsDraftEntry -> updateDraftEntry{fieldType}Value -> submitGravityFormsDraftEntry flow.

Similarly, we've added support for updating entries and draft entries with a single mutation each, and added support for using form and entry IDs in queries - without needing to convert them to a global ID first. We also deprecated fields in favor of formFields, so there's less confusion between GF fields and GraphQL fields.

Also, we made several (breaking) changes to streamline queries and mutations: many GraphQL properties have been changed to Enum types, and formFields (and the now-deprecated fields) are now an interface. This should make your queries and mutations less error-prone and (a bit) more concise. We're also now using native Gravity Forms functions wherever possible, which should help ensure consistency going forward.

Beyond that, we've squashed some bugs, deprecated some confusing and unnecessary fields, and refactored a huge portion of the codebase that should speed up development and improve code quality in the long term.

New features

  • Added submitGravityFormsForm mutation to bypass the existing draft entry flow. See README.MD for usage.
  • Added updateGravityFormsEntry and updateGravityFormsDraftEntry mutations that follow the same pattern.
  • Added idType to GravityFormsForm and GravityFormsEntry, so you can now query them using the database ID, instead of generating a global id first.
  • Added id property to FieldErrors, so you know which failed validation.
  • Deprecated the fields property on GravityFormsForm and GravityFormsEntry in favor of formFields.
  • Support cloning an existing entry when using createGravityFormsDraftEntry using the fromEntryId input property.
  • Converted all Gravity Forms formFields (and the now-deprecated fields) to a GraphQL Interface type. That means your queries can now look like this:
query {
  gravityFormsForms {
    nodes {
      formFields {
        nodes {
          formId
          type
          id
          ... on AddressField {
            inputs {
              defaultValue
            }
          }
          ... on TextField {
            defaultValue
          }
        }
      }
    }
  }
}
  • Switched many field types from String to Enum:
  • AddressField.addressType
  • Button.type
  • CaptchaField.captchaTheme
  • CaptchaField.captchaType
  • CaptchaField.simpleCaptchaSize
  • ChainedSelectField.chainedSelectsAlignment
  • ConditionalLogic.actionType
  • ConditionalLogic.logicType
  • ConditionalLogicRule.operator
  • DateField.calendarIconType
  • DateField.dateFormat
  • DateField.dateType
  • EntriesFieldFilterInput.operator
  • EntriesSortingInput.direction
  • Form.descriptionPlacement
  • Form.labelPlacement
  • Form.limitEntriesPeriod
  • Form.subLabelPlacement
  • FormConfirmation.type
  • FormNotification.toType
  • FormNotificationRouting.operator
  • FormPagination.style
  • FormPagination.type
  • GravityFormsEntry.fieldFiltersNode
  • GravityFormsEntry.status
  • NumberField.numberFormat
  • PasswordField.minPasswordStrength
  • PhoneField.phoneFormat
  • RootQueryToGravityFormsFormConnection.status
  • SignatureField.borderStyle
  • SignatureField.borderWidth
  • TimeField.timeFormat
  • visibilityProperty
  • FieldProperty: descriptionPlacement
  • FieldProperty: labelPlacement
  • FieldProperty: sizeProperty

Bugfixes

  • SaveAndContinue now uses buttonText instead of the Button type.
  • lastPageButton now uses its own GraphQL type with the relevant fields.
  • The resumeToken input field on the deleteGravityFormsDraftEntry, SubmitGravityFormsDraftEntry, and all the updateDraftEntry{fieldType}Value mutations is now a non-nullable String!.
  • When querying entries, we check that createdByID is set before trying to fetch the uerdata.
  • Where possible, mutations and queries now try to return an errors object instead of throwing an Exception.
  • We've added more descriptive Exception messages across the plugin, to help you figure out what went wrong.
  • We fixed a type conflict with ConsentFieldValue. value now returns a String with the consent message, or null if false.
  • Deprecated url in favor of value on FileUploadFieldValue and SignatureFieldValue.
  • Deprecated cssClassList in favor of cssClass.
  • The resumeToken input field on the deleteGravityFormsDraftEntry, SubmitGravityFormsDraftEntry, and all the updateDraftEntry{fieldType}Value mutations is now a non-nullable String!.

Under the hood

  • Refactored Fields, FieldValues, and Mutations, removing over 500 lines of code and improving consistency across classes.
  • Switch to using GFAPI::submit_form() instead of local implementations for submitting forms and draft entries.
  • Implemented phpstan linting.
  • Migrated unit tests to Codeception, and started backfilling missing tests.
  • Updated composer dependencies.