We consider the problem of learning a general graph using edge-detecting queries. In this model, the learner may query whether a set of vertices induces an edge of the hidden graph. This model has been studied for particular classes of graphs by Kucherov and Grebinski [7] and Alon et al.[3], motivated by problems arising in genome sequencing. We give an adaptive deterministic algorithm that learns a general graph with n vertices and m edges using O(m log n) queries, which is tight up to a constant factor for classes of non-dense graphs. Allowing randomness, we give a 5-round Las Vegas algorithm using O(m log n + √ m log2 n) queries in expectation. We give a lower bound of Ω((2m/r)r/2 ) for learning the class of non-uniform hypergraphs of dimension r with m edges.