Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
452
stars
199
forks
source link
Passing nil for an optional parameter throws an error #1221
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.
I'm creating a checkout using the
checkoutCreate
mutation. According to the docs, theemail
parameter is optional. But if I passnil
to it, the APi call fails.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
.