Ocamlgraph's types are abstract, so you can't automatically apply derivers on them. You have to define your own, but that can be pretty easy. One way is to convert the abstract type to some other type, and derive the serializer on that type. Something like this:
module G : sig
include module type of Graph.Persistent.Digraph.Concrete(Int)
val of_list : int list -> t
val to_list : t -> int list
val sexp_of_t : t -> Sexp.t
val t_of_sexp : Sexp.t -> t
end = struct
include Graph.Persistent.Digraph.Concrete(Int)
let of_list (l : int list) : t = (* implement this *)
let to_list (t : t) : int list = (* implement this *)
let sexp_of_t t = [%sexp_of: int list] (to_list t)
let t_of_sexp sexp = [%of_sexp: int list] sexp |> of_list
end