A high-fat diet attenuates type 2 diabetes risk via interaction with GIPR, whereas a high-carbohydrate diet elevates this risk through the same genetic interaction. Here, GIPR is linked to type 2 diabetes mellitus.