We study heat rectification in composition-graded nanowires, with nonlocal and nonlinear effects taken into account in a generalized Guyer-Krumhansl equation. Using a thermal conductivity dependent on composition and temperature, the heat equation is solved. Introducing a non-vanishing heat supply (as for instance, a lateral radiative heat supply), we explore the conditions under which either nonlocal or nonlinear effects or both contribute to heat rectification and how they may be controlled by means of the external radiative flux. The corresponding rectification coefficients are calculated as well, and the physical conditions under which the system becomes a thermal diode are pointed out.