GraphQL

Query Forms

Formie exposes forms, pages, rows and fields through GraphQL. This is useful when you need to build your own front-end, inspect a form’s field layout, or fetch the settings your app needs before rendering a form.

Use formieForm when you expect one form, or formieForms when you need a list.

{
    formieForm(handle: "contactForm") {
        title
        handle
        isAvailable

        settings {
            errorMessageHtml
            submitMethod
            completionBehavior
            completionRedirectSource
        }

        pages {
            label

            rows {
                rowFields {
                    label
                    handle
                    typeName
                    inputTypeName

                    ... on Field_Name {
                        fields {
                            label
                            handle
                            enabled
                            required
                        }
                    }

                    ... on Field_Email {
                        placeholder
                        validateDomain
                    }
                }
            }
        }
    }
}

Select the Fields Your Page Needs

For a contact form with handle contactForm, run this query in Craft's GraphQL explorer using a schema that can read that form:

query ContactFields {
    formieForm(handle: "contactForm") {
        handle
        formFields {
            handle
            inputTypeName
        }
    }
}

The response pairs each field handle with the input type accepted by its submission mutation. Use those names when constructing a typed mutation; a Name field takes a structured value while a Single-Line Text field takes a string. See Create Submissions for both examples.

Querying the form does not grant access to saved submissions. A client that submits answers also needs submission-creation access for this form. Keep private submission-query scopes out of public browser schemas.

Detailed Reference

See GraphQL Form Reference for the complete lookup, including types and field-specific options.