getCheckEmailOtpValid method

Future<bool> getCheckEmailOtpValid(
  1. String emailId,
  2. String otp
)

Implementation

Future<bool> getCheckEmailOtpValid(String emailId, String otp) async {
  String checkPassGql = """
                          query getCheckEmailOtpValid(\$emailId: String, \$otp: String) {
            getCheckEmailOtpValid(emailId: \$emailId, otp: \$otp)
          }

      """;
  GraphQLConfiguration graphQLConfiguration = GraphQLConfiguration();
  GraphQLClient _client = graphQLConfiguration.clientToQuery();
  final vble = {"emailId": emailId, "otp": otp};
  QueryResult result = await _client.query(QueryOptions(
    document: gql(checkPassGql),
    variables: vble,
    fetchPolicy: FetchPolicy.networkOnly,
  ));
  if (!result.hasException) {
    var checkEmailOtp = result.data!['getCheckEmailOtpValid'];
    if (checkEmailOtp != null && checkEmailOtp == true) {
      return true;
    } else {
      return false;
    }
  }
  return false;
}