Let $\textbf{Graph}$ be the category of (undirected) graphs. Consider a graph $I$ that consists of a single edge. Note that for every graph $G$ there exists a bijection
$$\mathrm{Hom}_{\textbf{Graph}}(I,G) \cong \mbox{ the set of edges of }G$$
natural in $G$. In other words the functor sending each graph to its set of edges is represented by $I$.
Let $pt$ be a graph with exactly one vertex. Then we have another natural bijection
$$\mathrm{Hom}_{\textbf{Graph}}(pt,G) \cong \mbox{ the set of vertices of }G$$
Suppose that $i_0,i_1:pt\rightarrow I$ are two distinct morphisms (endpoints of $I$).
Now pick graphs $G_1, G_2$ and let $\textbf{Hom}(G_1,G_2)$ be their exponential object (we assume that it exists). Then
$$\mathrm{Hom}_{\textbf{Graph}}(G_1\times I,G_2) \cong \mathrm{Hom}_{\textbf{Graph}}\left(I,\textbf{Hom}(G_1,G_2)\right) \cong \mbox{ the set of edges of }\textbf{Hom}(G_1,G_2)$$
So each edge in $\textbf{Hom}(G_1,G_2)$ corresponds uniquely to a morphism of graphs $f:G_1\times I \rightarrow G_2$. Now you can also verify that the edge corresponding to $f$ has precisely $f\cdot i_0,f\cdot i_1:G_1\cong G_1\times pt\rightarrow G_2$ as its endpoints.
This I think recovers the answer given by Tom Leinster above.