fetch method

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

Fetches data from Sanity by running the GROQ Query with the passed in parameters

Implementation

Future<SanityQueryResponse> fetch(String query,
    {Map<String, String>? params}) async {
  final uri = queryUrl(query, params: params);
  final response = await httpClient.get(uri, headers: _requestHeaders);

  return _getQueryResult(response);
}