r0man/alumbra.printer

A pretty printer for the Alumbra AST.


Keywords
alumbra, clojure, clojurescript, graphql
License
MIT

Documentation

alumbra.printer

https://img.shields.io/clojars/v/r0man/alumbra.printer.svg https://travis-ci.org/r0man/alumbra.printer.svg http://jarkeeper.com/r0man/alumbra.printer/status.svg https://jarkeeper.com/r0man/alumbra.printer/downloads.svg

A pretty printer for the Alumbra AST.

Usage

Parse a GraphQL document.

(require '[alumbra.parser :as parser])
(require '[alumbra.printer :as printer])

(def my-document
  (parser/parse-document "{ human(id: \"1000\") { name height(unit: FOOT) } }"))

Print the document.

(printer/print my-document)
query { human(id: "1000") { name  height(unit: FOOT)  }  }

Pretty print the document.

(printer/pprint my-document)
query {
  human(id: "1000") {
    name
    height(unit: FOOT)
  }
}

License

MIT License, Copyright (c) 2019 r0man