graphql / graphql-js

A reference implementation of GraphQL for JavaScript
http://graphql.org/graphql-js/
MIT License
20.08k stars 2.03k forks source link

Feature request: prettyPrint #1799

Open mjmahone opened 5 years ago

mjmahone commented 5 years ago

Request: Add a Pretty-Printing function to go from AST => well-formatted string

This is a utility I've wanted to exist as part of the core library for a long time. @adek05 began a simple implementation of this in #1557. The Prettier library has even implemented a version of this: https://github.com/prettier/prettier/tree/master/src/language-graphql

Ideal API (I think)

Why not re-use print?

What are potential use cases?

imolorhe commented 5 years ago

Was just about to create an issue for this. 😄 👍