Converting Postgresql into knex.js

I am Using knex and objection to make an API. I am trying to translate the SQL below into knex without using raw so I can get all posts associated with a list of groups and other users. The data is spread across 4 tables groups, posts, votes, and friends.

select posts.*, sum(, users.full_name
            from users, posts left outer join voted
            on = voted.post_id
            where( = posts.user_id and posts.group_id = ${group_id})
            group by, voted.post_id, users.full_name;