Skip to content

[Question] How to define the "description" for fields? #251

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

Closed
yaquawa opened this issue Aug 8, 2018 · 3 comments
Closed

[Question] How to define the "description" for fields? #251

yaquawa opened this issue Aug 8, 2018 · 3 comments
Labels
question Request for support or clarification

Comments

@yaquawa
Copy link
Contributor

yaquawa commented Aug 8, 2018

Is there an easy way to define "description" for each fields?

Maybe we can do it like #description ... or define them in separate config file will be a good solution?

@chrissm79 chrissm79 added the question Request for support or clarification label Aug 8, 2018
@chrissm79
Copy link
Contributor

If you're using v2.1 or v2.0 you can add a description to each field by prepending it w/ # like so:

type User {
    # First name of user
    first_name: String

    # Last name of user
    last_name: String
}

In v2.2 (currently in beta), you need to use the new triple quotes (the # will not throw any errors, it's just considered a comment instead of a description)

type User {
    """First name of user"""
    first_name: String

    """Last name of user"""
    last_name: String
}

The change in syntax was introduced here.

@yaquawa
Copy link
Contributor Author

yaquawa commented Aug 8, 2018

@chrissm79 Cool! Thanks!!

@chrissm79
Copy link
Contributor

@yaquawa no problem!

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

No branches or pull requests

2 participants