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.

Hi,

I didn’t see a printer in the repository anywhere, something like https://github.com/graphql/graphql-js/blob/master/src/language/printer.js.

So I wrote one: https://gist.github.com/dminkovsky/b5efd2df4a13c6c89a01c5c49fbdffc8#file-graphqlprinter-java

I haven’t fully tested this. But the AST I’ve needed to print has printed correctly. Thought maybe to contribute. Are there other plans for a printer?

Regarding the implementation/style, the way it is now, it could use some double dispatch with Node. But the big switch works. Also, I considered/attempted/aborted writing a reducing<String> visitor as in LB’s JS implementation, but the approach I took was just much simpler for me.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
RusticFlarecommented, Sep 14, 2017

(Because I still had to go looking for this)

You can print by using the SchemaPrinter class.

SchemaPrinter schemaPrinter = new SchemaPrinter();
schemaPrinter.print(schema);
1reaction
andimarekcommented, Aug 18, 2016

A direct jackson dependency is not an option, imho: We should add only dependencies we really need or want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a Printer? - Computer Hope
A printer is an external hardware output device that takes the electronic data stored on a computer or other device and generates a...
Read more >
Home & Office Printers | Amazon.com
Shop for inkjet, laser, wireless, all-in-one, and more best-selling printers on Amazon.com for the home, office, or business.
Read more >
Shop All Printer Types and Brands - Best Buy
Shop Best Buy for a printer for your home or office. Choose from our great selection of printer types and brands.
Read more >
What are printers and how do they work? - TechTarget
A printer is a device that accepts text and graphic output from a computer and transfers the information to paper, usually to standard-size,...
Read more >
Printer (computing) - Wikipedia
In computing, a printer is a peripheral machine which makes a persistent representation of graphics or text, usually on paper.
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