Just for knowledge for whoever needs, here is the full query for what I wanted to do:
match
$user isa user, has id "<user-id>";
fetch
$user: id, first_name, profile_photo;
"user_roles": {
match
$role isa role;
$user_roles (ur_user: $user, ur_role: $role) isa user_roles;
fetch
$role: role_authority;
};
"user_groups": {
match
$group isa group;
$user_groups (ug_user:$user, ug_group: $group) isa user_groups;
fetch
$group: id, group_name;
"group_roles": {
match
$role isa role;
$group_roles (gr_group: $group, gr_role: $role) isa group_roles;
fetch
$role: role_authority;
};
};