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

Comments not working in 0.4.4 #324

Closed
andrewmunro opened this issue Aug 28, 2018 · 5 comments
Closed

Comments not working in 0.4.4 #324

andrewmunro opened this issue Aug 28, 2018 · 5 comments

Comments

@andrewmunro
Copy link

andrewmunro commented Aug 28, 2018

After our upgrade to 0.4.4, comments have stopped working.

Expected Behaviour

Comments should be viewable via the introspection API.

Actual Behavior

No comments are displayed for any fields or types.

Steps to reproduce

Run any of the examples in gqlgen. E.G Starwars:

image

@andrewmunro
Copy link
Author

Believe the issue is somewhere around here: https://github.com/vektah/gqlparser/blob/master/parser/schema.go#L72

The comments are never set on the definition.

@vektah
Copy link
Collaborator

vektah commented Aug 29, 2018

Comments are ignored by the parser, descriptions are strings placed before the field or type:

""" This is a description for Foo"""
type Foo {
}

# This is a comment, it does nothing.
type Bar {
}

Upstream change is here graphql/graphql-js#927

@vektah vektah closed this as completed Aug 29, 2018
@andrewmunro
Copy link
Author

@vektah Appears to be working for types and enum values, but not fields. Could we update the examples to show this?

@vektah vektah reopened this Aug 29, 2018
@mathewbyrne
Copy link
Contributor

mathewbyrne commented Sep 7, 2018

@andrewmunro as far as I can tell this is working for fields as well. Given the type:

"""Description for User"""
type User {
    id: ID!
    """Description for User.name"""
    name: String!
}

I see:

image

@andrewmunro
Copy link
Author

Confirmed working as intended.

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

3 participants