add _referring feature to the query macro