correct use of queryByHook and queryAll