verifyQuery static method

Future<void> verifyQuery(
  1. ExecutableQuery query, {
  2. Options options = const Options(),
})

Implementation

static Future<void> verifyQuery(
  ExecutableQuery query, {
  Options options = const Options(),
}) async {
  try {
    // Get the query string from the ExecutableQuery instance
    final queryString = query.getQuery();

    // Write and possibly execute the query, then verify the result
    final resultString = await query.executeQuery(queryString);

    // Use the existing verify method to check the result against approved content
    verify(resultString, options: options);
  } catch (_) {
    rethrow;
  }
}