Heat a Dutch oven over low heat and add the oil. Add the onions and sweat until translucent, 8 to 10 minutes. Increase the heat to medium, add the apples, tossing well, and cook until they start to brown. Add the rice and thyme. Cook for 1 to 2 minutes, then add the chicken stock, apple juice, butter, vinegar and some salt and bring to a simmer. Cover, reduce the heat to low and cook until the rice is tender, about 20 minutes.