Issue submitting forms with via GraphQL - expecting ENUM instead of string values (multi-select)

  • Goal: Send form data via a graphQL mutation - where selected multiselect component values are passed as ENUMs instead of String values for a specific field.

  • Context: I am trying to submit a form via graphql mutation -> most functionality is working but I am having an issue with multiselect form inputs. When referencing the forms multiselect values -> I get an array of Strings (see screenshot 1). However, my custom graphql mutation requires type ENUM. I have tried many ways to solve this but have not managed. I just need a way to convert the string values to ENUM (removing the quotation marks).

E.g. "BILLING" to BILLING

Example of table + form:

Example of String Array and graphQL mutation.

Any help would be much appreciated.

I think the type of $addressTypes is wrong. It should be array type, i.e. [AddressType] if you want to pass multiple values in to it.

Other than that, when you use variables, string values like "BILLING" should work as value for enum BILLING

If you still have issue, can you share some screenshot of the error you're seeing?

Ah that solved the issue. Thank you!

You're welcome!