createQueryVar function
Implementation
Expression createQueryVar(
BaseParameterAnnotation annotation,
ServerParam param,
) {
if (annotation is! ServerQueryAnnotation) {
throw ArgumentError('Invalid annotation type: ${annotation.runtimeType}');
}
var queryVar = refer('context').property('request');
if (annotation.all) {
queryVar = queryVar.property('queryParametersAll');
} else {
queryVar = queryVar.property('queryParameters');
}
return queryVar.index(literalString(annotation.name ?? param.name));
}