Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input = Storefront.CustomerUpdateInput.create(
- firstName: .value("John")
- )
- let mutation = Storefront.buildMutation { $0
- .customerUpdate(customerAccessToken: "<customer access token>", customer: input) { $0
- .customer { $0
- .firstName()
- }
- .userErrors { $0
- .field()
- .message()
- }
- }
- }
- let task = client.mutateGraphWith(mutation) { response, error in
- if let mutation = response?.customerUpdate, let customer = mutation.customer {
- print("[INFO] Update Customer success: \(customer)")
- } else {
- print("[ERROR] Update Customer failed: \(error)")
- }
- }
- task.resume()
Add Comment
Please, Sign In to add comment