Graphql-js: language/printer not handle line break for comment inside args

Created on 12 Mar 2018  路  1Comment  路  Source: graphql/graphql-js

Hi guys,

I report you a bug find with the graph.cool team and about Prisma cli and the generation of the SDL schema.
You can see the initial discussion here: https://github.com/graphcool/prisma/issues/2047

The bug is about highlighting in VSC (maybe a bug about the GraphQL Syntax plugin), but in fact I see a difference between the function printSchema and print.
The problem is just about a missing line break before a comment when it's about args for a "function"

capture d ecran 2018-03-08 a 17 29 40

If printSchema was fixed previous month (here https://github.com/graphql/graphql-js/pull/1205), the print function not handle correctly comments for function's args:
https://github.com/graphql/graphql-js/blob/3493edd23027d2a7ab016b80b4206e3bd0ff731a/src/language/printer.js#L131-L138

I think it just need so verification so see if the args begins or contains some comments to add a line break.

Thanks for your help!

Most helpful comment

Thanks for the report. This is definitely a bug in VCS's syntax highlighter, however I agree that the output of print() could be improved

>All comments

Thanks for the report. This is definitely a bug in VCS's syntax highlighter, however I agree that the output of print() could be improved

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thomasdingemanse picture thomasdingemanse  路  4Comments

pranshuchittora picture pranshuchittora  路  3Comments

matthewgertner picture matthewgertner  路  4Comments

adriano-di-giovanni picture adriano-di-giovanni  路  3Comments

rafgraph picture rafgraph  路  4Comments