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

printSchema: not valid comments #1245

Closed
hendrul opened this issue Feb 15, 2018 · 5 comments
Closed

printSchema: not valid comments #1245

hendrul opened this issue Feb 15, 2018 · 5 comments

Comments

@hendrul
Copy link

hendrul commented Feb 15, 2018

I must be doing something wrong, no one else seems to complain... my schema is being printed with comments with wrong syntax like...

"""
A signed eight-byte integer. The upper big integer values are greater then the
max value for a JavaScript number. Therefore all big integers will be output as
strings and not numbers.
"""
scalar BigInt

the expected syntax is

# A signed eight-byte integer. The upper big integer values are greater then the
# max value for a JavaScript number. Therefore all big integers will be output as
# strings and not numbers.
scalar BigInt
@hendrul
Copy link
Author

hendrul commented Feb 15, 2018

Ohh I see, it has an undocumented option "commentDescriptions"

// Generates comments right
printSchema(schema, { commentDescriptions: true })

@galki
Copy link

galki commented Feb 15, 2018

did that option work for you? ok its gotta be true, not false

@IvanGoncharov
Copy link
Member

the expected syntax is

@hendrul Version 0.13.0 introduced some breaking changes to SDL syntax, see here:
https://github.com/graphql/graphql-js/releases/tag/v0.13.0

commentDescriptions was added as an option to provide the backward compatible format of descriptions.

@hendrul
Copy link
Author

hendrul commented Feb 15, 2018

Ok I see, cool!, now this option needs to be known

@leebyron
Copy link
Contributor

This behavior has been around since v0.12 and was documented in the release notes!
https://github.com/graphql/graphql-js/releases/tag/v0.12.0

Note that the block string is the correct syntax for descriptions in the SDL - we used to use comments before we had a completed specification for this feature.

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

4 participants