The use of ``z_context:get_q/3`` would be perfect here.

Another option is to add an extra function:

     process_get(_ReqData, Context)
         Query = ...
         process_get_query(Query, Context).

     process_get_query(undefined, Context) -> process_get_query(all, Context),
     process_get_query(Query, Context) -> process_get_query(Query, Context).