checkoutCustomerAssociate method
Associates the Customer
that customerAccessToken
belongs to, to the Checkout that checkoutId
belongs to.
Implementation
Future<void> checkoutCustomerAssociate(
String checkoutId, String customerAccessToken,
{bool deleteThisPartOfCache = false}) async {
final MutationOptions _options = MutationOptions(
document: gql(associateCustomer),
variables: {
'checkoutId': checkoutId,
'customerAccessToken': customerAccessToken
});
final QueryResult result = await _graphQLClient!.mutate(_options);
checkForError(
result,
key: 'checkoutCustomerAssociateV2',
errorKey: 'checkoutUserErrors',
);
if (deleteThisPartOfCache) {
_graphQLClient!.cache.writeQuery(_options.asRequest, data: {});
}
}