createQueryArg function

Expression createQueryArg(
  1. Iterable<ClientParam> params
)

Implementation

Expression createQueryArg(Iterable<ClientParam> params) {
  assert(params.isNotEmpty, 'No query params found');
  assert(
    params.every((param) => param.position == ParameterPosition.query),
    'Not all params are query params',
  );

  return createMap({
    for (final param in params)
      switch (param.access) {
        [final String access] => access,
        _ => param.name,
      }: refer(
        param.name,
      ).code,
  });
}