pull query from config