verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 69 forks source link

[5.x] Generated GraphQL types for name/address fields don't exist. #1868

Closed benfeather closed 1 month ago

benfeather commented 1 month ago

Describe the bug

The GQL types for fields with nested fields throw an error when used in a mutation.

Here is the data for the name field in my demo form:

CleanShot 2024-05-06 at 15 30 31@2x

It has the type: kitchenSink_nameMulti_FormieNameInput

But if I use that type in GraphiQL, it throws an error:

CleanShot 2024-05-06 at 15 32 04@2x

CleanShot 2024-05-06 at 15 32 26@2x

The address field appears to do the same.

Steps to reproduce

N/A

Form settings

Craft CMS version

5.1.1

Plugin version

dev-craft-5 as 3.0.0-beta.9

Multi-site?

Yes

Additional context

No response

benfeather commented 1 month ago

I got the mutation code from the docs:

https://verbb.io/craft-plugins/formie/docs/developers/graphql#submissions-1

// Query
mutation saveSubmission($yourName:contactForm_yourName_FormieNameInput $yourAddress:contactForm_yourAddress_FormieAddressInput) {
    save_contactForm_Submission(yourName: $yourName, yourAddress: $yourAddress) {
        yourName
        yourAddress
    }
}

// Query Variables
{
    "yourName": {
        "firstName": "Peter",
        "lastName": "Sherman"
    },
    "yourAddress": {
        "address1": "42 Wallaby Way",
        "city": "Sydney",
        "zip": "2000",
        "state": "NSW",
        "country": "Australia"
    }
}
engram-design commented 1 month ago

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.0-beta.9".

benfeather commented 1 month ago

Looks good to me, Thanks!