move query resolution to queries service