question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignore commented code

See original GitHub issue

Currently when a string with the gql tag exists but is commented, there will be an exception:

{ GraphQLError: Syntax Error ./xxxx/container-component.tsx (2:1) Cannot parse the unexpected character "/".

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dotansimhacommented, Nov 23, 2018

@jonaskello @FredyC We recently merged this: https://github.com/dotansimha/graphql-code-generator/pull/907 , now the codegen will parse the code file as AST and extract the documents from it.

1reaction
jonaskellocommented, Mar 14, 2018

IMO, using strip-comments is a simpler solution and therefore better 😃. If there are more advanced code-analysis needed later we can look into parsing into an abstract syntax tree at that point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make git ignore comments in file? - Stack Overflow
Just keep the comment committed latest. My point is that the comment should somehow explain the code, so if the code is not...
Read more >
VSCode fails to ignore commented lines in commit template ...
Yes VS Code Version: Version: 1.60.2 (user setup) Commit: ... ignore commented lines in commit template when configured comment char #133770.
Read more >
Why is it wrong to comment out code and then gradually ...
Leaving commented code in your code base is a bad practice but that is not what you are doing if you work through...
Read more >
How to relax rules for "Remove this commented out code"?
Hi Sonar Team,. Is there any way to relax the comment out code in Sonarqube. There are lot of commented out lines in...
Read more >
Please, don't commit commented out code - Kent C. Dodds
However commented out code does not justify its existence. It wont take long before that commented code is out of context, no longer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found