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

Use ``` to comment before extend type will get "Unexpected BlockString" #3915

Closed
VictoriaChou opened this issue Mar 23, 2020 · 2 comments
Closed

Comments

@VictoriaChou
Copy link

Here is my example:

"""
The query root of XXX GraphQL interface.
"""
extend type Query {
    """
    Gets info about apple
    """
    Apple {
    }
}

And the first comment is not allowed and return Unexpected BlockString
If i remove extend or if i use # instead of """ it will be all right
The second comment is ok.

@mainpart
Copy link

can confirm that :)

@glasser
Copy link
Member

glasser commented Jan 11, 2022

This is spec-compliant. You can see in the spec that Description is part of ObjectTypeDefinition but not part of ObjectTypeExtension.

I think this makes some sense, because if you provide a description both on the type definition and on a type extension (or on multiple type extensions) then it would need to know how to combine the descriptions. One could imagine it being legal as one as there is only one anywhere, but that's not the choice that was made.

More discussion on the spec itself at graphql/graphql-spec#900

@glasser glasser closed this as completed Jan 11, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants