signInWithMultipassToken method
Tries to sign in a user with the given Multipass token.
Implementation
Future<ShopifyUser> signInWithMultipassToken(
final String multipassToken, {
bool deleteThisPartOfCache = false,
}) async {
final String? customerAccessToken =
await _createAccessTokenWithMultipass(multipassToken);
final WatchQueryOptions _getCustomer = WatchQueryOptions(
document: gql(getCustomerQuery),
variables: {'customerAccessToken': customerAccessToken});
final QueryResult result = await _graphQLClient!.query(_getCustomer);
checkForError(result);
final shopifyUser = ShopifyUser.fromGraphJson(result.data!['customer']);
await _setShopifyUser(customerAccessToken, shopifyUser);
if (deleteThisPartOfCache) {
_graphQLClient!.cache.writeQuery(_getCustomer.asRequest, data: {});
}
return shopifyUser;
}