-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Question: difference between comments and descriptions? #420
Comments
@tonyghita Yes it does.
type Person {
"""name of a person"""
name: String
#TODO: Add surname
# FIXME: Commented due to crash
# avatarUrl: String
} So comments are completely ignored by GraphQL. They even skipped by parser so it makes them equivalent to whitespaces. You can read about this change in more details here: graphql/graphql-js#927 |
Thanks for the clarification and references @IvanGoncharov 👍 |
Time to update the docs with this info :) I can't see it anywhere here: https://graphql.org/learn/schema/#the-query-and-mutation-types I seem to only be able to find it on unofficial resources. Cheers! |
"""
comment 1
"""
type Query {
# comment 2
hello(
"comment 3"
name: String
): String
} Comments can be written in Markdown. Spec section on descriptions: http://spec.graphql.org/draft/#sec-Descriptions |
Previous to merging descriptions into the specification, we used comments to document each field and type.
Does the introduction of descriptions deprecate the old functionality of comments? If so, what is the intended usage of comments? If not, what is the difference between comments and descriptions?
The text was updated successfully, but these errors were encountered: