rmosolgo / graphql-ruby

Ruby implementation of GraphQL
http://graphql-ruby.org
MIT License
5.38k stars 1.39k forks source link

Print descriptions as strings when printing schema #2002

Closed rylanc closed 5 years ago

rylanc commented 5 years ago

The GraphQL SDL spec specifies strings or block strings as the format for field/type/argument descriptions. In the current version of graphql-ruby, strings are printed using comments (although, it looks like block string descriptions are parsed correctly). It should be easy enough to change, but before I put in too much work, I wanted to get some thoughts:

  1. Should the printer still support comment descriptions?
  2. If so, should the default be block strings or comments?
rmosolgo commented 5 years ago

Hey, thanks for raising this issue! I think it would be great to update the printer to use block strings. For compatibility, it's nice to parse both comments and block strings, but I think defaulting to block strings would be a great update.

I don't think it's important to support comment descriptions. The only use I know for the schema printer is internal tooling, and it should be alright to make the switch to block strings.