Why isn't this function affine? I'm studying convex optimization using Convex Optimization (Boyd & Vandenberghe) and had a question from an example used in Chapter 4.2: Convex Optimization.
The specific example is as follows:

$$\begin{array}{ll} \text{minimize} & f_0(x) = x_1^2 + x_2^2\\ \text{subject to} & f_1(x) = \frac{x_1}{1+x_2^2} \le 0\\ & h_1(x) = (x_1 + x_2)^2 = 0\end{array}$$

The textbook states that this problem is not a convex optimization problem because the equality constraint $h_1(x)$ is not affine.
I'm aware that affine functions are linear functions composed with a translation, but when I plotted out the graph for $h_1(x)$ I get a line or plane, which are both affine sets. This led to my confusion as to why the function isn't affine if it's graph is an affine set.
Why isn't it an affine function? Is my understanding of what an affine function is itself wrong?

$$h_1 (\mathrm x) = \left( 1_2^\top \mathrm x \right)^2 = \mathrm x^\top  1_2 1_2^\top \mathrm x$$
is a positive semidefinite quadratic form that vanishes at the line defined by $1_2^\top \mathrm x = 0$. However, function $h_1$ is quadratic and, thus, non-affine.
