nrc / graphql

A Rust GraphQL server framework
Apache License 2.0
236 stars 12 forks source link

Add support for comments #29

Closed scrogson closed 6 years ago

scrogson commented 6 years ago

@nrc sounds good...thanks for pointing that out.

nrc commented 6 years ago

Replying to irc questions: yes, this should happen in parse_base, I think that bump and peek_token could be modified so they ignore comment tokens in the token stream. Alternatively you could just not record the comment tokens (ignore them at the lexer level). Intuitively, I feel like the former is better, but I can't actually think of a use case, so maybe the second option is better (since it is simpler).

scrogson commented 6 years ago

@nrc it looks like the SDL (Schema Definition Language) is being added to the spec https://github.com/facebook/graphql/pull/90

I still need to read through things in order to grok what it all means. There are some interesting things about comments as descriptions that might require us to handle comments in order to support deriving them automatically.

scrogson commented 6 years ago

After looking at it some more, it appears that the descriptions will use strings similar to python's docs and not comments. So I think we can just throw the comments out...

nrc commented 6 years ago

Awesome, thank you!