-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix error when printing a FieldDefinition
AST node without arguments
field
#1548
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
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@awfulaxolotl Sorry for the delay. @mjmahone Can you please review? |
@mjmahone General issue here is that |
@IvanGoncharov Nice catch. Your extended fix looks good to me! Looking forward to |
@mjmahone Can you please review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks you for finding and fixing this bug! Sorry for my review delay, but @IvanGoncharov seems to have helped move this fix along well. Thank you both!
…ts` field (graphql#1548) * Fix error when printing a `FieldDefinition` AST node without arguments * Generalize solution
I encountered a runtime type error while printing some hand-constructed
FieldDefinition
AST nodes which conform to the type spec.Problem
Type spec - declaring it's optional:
graphql-js/src/language/ast.js
Line 444 in 26c9874
Printing implementation - requiring it:
graphql-js/src/language/printer.js
Line 139 in 7874229
Solution
This PR fixes this discrepancy in the implementation with a default value.
https://github.com/awfulaxolotl/graphql-js/blob/df56ba3eadbfbc282ae6262927dfaeb162662158/src/language/printer.js#L139