Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema-first approach does not support single line and mutliline documentation #647

Closed
michaelstaib opened this issue Mar 23, 2019 · 9 comments
Assignees
Milestone

Comments

@michaelstaib
Copy link
Member

michaelstaib commented Mar 23, 2019

Currently, the schema-first approach does not support single line and mutliline documentation (see GraphQL Specifications from June 2018).

The following one will not work when we try to use the schema-first approach:

"""
A simple GraphQL schema which is well described.
"""
type Query {
  """
  Translates a string from a given language into a different language.
  """
  translate(
    "The original language that `text` is provided in."
    fromLanguage: Language

    "The translated language to be returned."
    toLanguage: Language

    "The text to be translated."
    text: String
  ): String
}

"""
The set of languages supported by `translate`.
"""
enum Language {
  "English"
  EN

  "French"
  FR

  "Chinese"
  CH
}

I made a little research and I didn't manage to find any .net GraphQL implementation that supports this. Is this one related to this issue? Thx you 🙄

@michaelstaib
Copy link
Member Author

@radubuciuceanu I have taken your example and create a test with it .... the parser reads it correctly.

From what I can see in my tests is that just the enum values are missing descriptions. There seems to be a mapping issue.

"""
The set of languages supported by `translate`.
"""
enum Language {
  EN
  FR
  CH
}

I will write a bigger test with all the types to see if the schema factory misses some more descriptions.

I will create another rc tonight 0.8.1-rc.2. We will release this 0.8.1 next week with lots of bug fixes.

@michaelstaib
Copy link
Member Author

@radubuciuceanu thanks for reporting this issue

@michaelstaib
Copy link
Member Author

There is the pr if you want to follow along #648

@michaelstaib
Copy link
Member Author

OK, the bug should be fixed.

@michaelstaib michaelstaib self-assigned this Mar 23, 2019
@michaelstaib michaelstaib added this to the 0.8.1 milestone Mar 23, 2019
@michaelstaib
Copy link
Member Author

Ok, this one is now fixed and under test.

I have triggered a new rc build which should be public in an hour.
https://github.com/ChilliCream/hotchocolate/releases/tag/0.8.1-rc.2

Would be great if you could give feedback on this one @radubuciuceanu

@michaelstaib
Copy link
Member Author

OK, it is public https://www.nuget.org/packages/HotChocolate/0.8.1-rc.2

@radubuciuceanu
Copy link

@michaelstaib As I remember, when I tested it, the documentations from the GraphQL schema were ignored. Anyway, I'll try it now one more time and I'll announce here the result. By the way, thx you for responding so fast ❤️

@radubuciuceanu
Copy link

I just tested it one more time. It worked well. Seems that, probably I was making something wrong... Anyway, I'm planning to use the schema-first approach in production so, if I find something else, I'll tell you. And thx you very much for being so responsive 😉

@michaelstaib
Copy link
Member Author

No prob. With version 9 we will bring lots of improvements for Schema-first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants