modifyForm
Changes the name and the elements of an existing form.
Where createForm creates a new form for a company, this mutation edits a form that already
exists, addressed by the formId input field. The owning company never changes. Both other input
fields are optional and are only applied when present, so you can rename a form without touching its
elements and vice versa.
Passing elements replaces the whole element list: the form ends up with exactly the elements you
send, in the order you send them, and any element you leave out is removed. Omitting elements
entirely leaves the current elements untouched. Each entry is matched against the form's existing
elements by its previousName input field, falling back to its name. A matched entry updates that
element in place, which means its FormElementType is fixed — the type input field only decides the
kind of a newly added element. An unmatched entry is added as a new element.
Passing name sets the form's Form.name; passing null, an empty string, or a string of only
whitespace clears it. Omitting name keeps the current one.
The mutation responds with an error, and the form is left unchanged, when: you are not connected to
the company that owns the form; an element whose FormElement.canBeRemoved is false is missing
from the list or is submitted as optional; a predefined element (FormElement.canBeModified is
false) is submitted with a changed name, labels or choices; a choice value is malformed; or a
validation URL is not a public endpoint. On success ModifyFormPayload.form carries the form as it
stands after the change.
mutation RenameForm($formId: String!, $name: String) { modifyForm(input: {formId: $formId, name: $name}) { form { id name elements { name canBeModified } } } }mutation RenameForm($formId: String!, $name: String) { modifyForm(input: {formId: $formId, name: $name}) { form { id name elements { name canBeModified } } } }
Arguments
| Argument | Description | Type |
|---|---|---|
| input | ModifyFormInput! |
Type
This field resolves to ModifyFormPayload, which has the following fields: