Connor Barratt has signed a new deal with Barnsley until 2027 with a club option for another year.