Fix generic warning in QueryBuilder by returning an immutable list instead