removeLinkedAccount static method

Future<String> removeLinkedAccount(
  1. String linkedAccountId,
  2. Request request, {
  3. Link? graphqlLink,
})

Implementation

static Future<String> removeLinkedAccount(
    String linkedAccountId, Request request,
    {Link? graphqlLink}) async {
  if (graphqlLink == null) graphqlLink = GraphLinkCreator.create(request);

  var req =
      GremoveLinkedAccount((b) => b..vars.linkedAccountId = linkedAccountId);
  var res = await graphqlLink
      .request(
          gql.Request(operation: req.operation, variables: req.vars.toJson()))
      .first;
  var errors = res.errors;
  if (errors != null && errors.isNotEmpty) {
    throw errors.first;
  }

  return GremoveLinkedAccountData_removeLinkedAccount_me.fromJson(res.data!)!
      .id;
}