fetch method

Future fetch(
  1. String query, {
  2. Map<String, dynamic>? params,
})

Fetches the query from the Sanity API.

Throws a SanityException in case request fails.

Implementation

Future<dynamic> fetch(String query, {Map<String, dynamic>? params}) async {
  final Uri uri = _buildUri(query, params: params);
  final http.Response response = await _client.get(uri);
  return _returnResponse(response);
}