Let $\mathcal{Sch}$ be the category of schemes. Let $\mathcal{Aff}$ be the category of affine schemes. Let $\mathcal{Sets}$ be the category of sets. Let $X$ be a scheme. Let $h_X\colon \mathcal{Sch}^{op} \rightarrow \mathcal{Sets}$ be the functor defined by $h_X(T) = Hom(T, X)$. By Yoneda lemma, $h_X \cong h_Y$ if and only if $X \cong Y$.
Let $g_X\colon \mathcal{Aff}^{op} \rightarrow \mathcal{Sets}$ be the restriction of $h_X$. Then $g_X \cong g_Y$ if and only if $X \cong Y$?