This question is related to Shopify’s Buy SDK for iOS.
I’m creating a checkout using the checkoutCreate mutation. According to the docs, the email parameter is optional. But if I pass nil to it, the API call fails.
let checkoutInput = Storefront.CheckoutCreateInput.create(
email: .value(email), // `email` is an optional string and I'm passing `nil` for that parameter
lineItems: .value(lineItemInput),
note: .value(note),
allowPartialAddresses: .value(true)
)
The .value(:) case itself accepts an optional string value according to the docs.
So I’m not sure why it causes the API call to fail if I actually pass in nil. Anyone who has experience in working with Shopify SDK, would appreciate any help.
Thanks!




