andreas / ocaml-graphql-server

GraphQL servers in OCaml
MIT License
624 stars 60 forks source link

Can Schema.interface propagate docs down to implementations? #152

Open phated opened 5 years ago

phated commented 5 years ago

Since abstract_field can receive a ~doc argument, would it be possible to provide that as a default for each implementation in the introspection query? This would be helpful to avoid duplicating documentation between abstract_field and field.

andreas commented 5 years ago

Thanks for the suggestion! I think it should be possible, though I'm wondering whether an implementation should be allowed to not inherit the doc string, and how to achieve this (optional argument ?propagate_doc for Schema.add_type?). It could probably be a convenient feature, but personally I have other features higher on my wish list 😄