nicolasdao / graphql-s2s

Add GraphQL Schema support for type inheritance, generic typing, metadata decoration. Transpile the enriched GraphQL string schema into the standard string schema understood by graphql.js and the Apollo server client.
Other
187 stars 15 forks source link

Comments of types are deleted #17

Closed yostools closed 5 years ago

yostools commented 6 years ago

Hello Niclas, thank you very much for your great extension.

During the integration into my project, I noticed that comments fields are retained, but the comments of types are lost. Regardless of whether it is a single-line comment ("...") or a multiline comment ("""...""").

In the following example, the comment on the "Comparison operators" is lost and the comment on the "EQ" is retained:

# ==================================================================================================================
# Enums
# ==================================================================================================================

"""
Comparison operators
See [Comparison Query Operators](https://docs.mongodb.com/manual/reference/operator/query-comparison/)
"""
enum ComparisonOperator {

  """
  Specifies equality condition. The [$eq](https://docs.mongodb.com/manual/reference/operator/query/eq/) operator 
  matches documents where the value of a field equals the specified value.
  """
  EQ
}

The comments introduced with "#" disappear, which is the intention.

nicolasdao commented 6 years ago

Very interesting @yostools. I didn't even know the """ ... """ convention.

I'm on holidays now. I'll integrate that ASAP.

nicolasdao commented 5 years ago

Closed with fix #32.