queryUrl method
Builds a URL for a GROQ query.
Implementation
@override
Uri queryUrl(String query, {Map<String, dynamic>? params}) {
final queryParameters = <String, dynamic>{
'query': query,
'explain': config.explainQuery.toString(),
'perspective': config.perspective.name,
if (params != null) ...params,
};
return Uri(
scheme: 'https',
host: '${config.projectId}.${config.useCdn ? 'apicdn' : 'api'}.sanity.io',
path: '/${config.apiVersion}/data/query/${config.dataset}',
queryParameters: queryParameters,
);
}