An undirected graph is sometimes defined as a pair of sets $V$ and $E$ (vertices and oriented edges), together with two maps $i,f: E\to V$ (sending a directed edge its initial/final vertex) and a map $s : E \to E$ (reversing the direction of an edge) satisfying $$i \circ s = f$$ $$f \circ s = i$$ $$s \circ s = 1_E$$ This definition makes sense in any category: we can replace sets $V,E$ by objects in the category and maps $i,f,s$ by morphisms in the category. In other words, a graph object in a category $\mathcal{C}$ as a functor $\mathcal{G}\to \mathcal{C}$, where $\mathcal{G}$ is the category with two objects $V,E$ and three nonidentity morphisms $i,f,s$, with composition defined by the identities above.
For example we can apply that definition in the category of groupoids (technically this is really a $2$-category, so we should probably talk about $2$-functors from $\mathcal{G}$, i.e. replace equality of morphisms in the three conditions above by isomorphism of 1-morphisms). Any groupoid can be thought of as a set with a group attached to each element. With this in mind, I believe that if we unpack the definitions we find that a graph object in the category of groupoids is exactly a graph of groups, but without the constraint that the morphisms from edge groups to vertex groups have to be monomorphisms (there are also some subtleties with half-loops, i.e. edges $e\in E$ such that $s(e)=e$, but these are usually excluded in the theory of graphs of groups, at least in the references I know).
Question: Has this point of view been studied before? Does the theory of graphs of groups (in particular the definition of the fundamental group) extend to this slightly more general setting, without the monomorphism condition and with half-loops allowed? If so, does this approach makes some proofs or definitions more elegant?
Secondary question: Is this notion of "graph object" interesting in any other category?