artemis.document

compose

added in 0.1.0

(compose doc & docs)

Compose multiple parsed documents together to create a single document.

inline-fragments

added in 0.1.0

(inline-fragments doc)

Given a parsed document that includes fragments, inline the values of the fragments directly into the query selection set(s).

operation

added in 0.1.0

(operation document)(operation document variables)(operation document variables inline-fragments?)

Given a document and some variables, return a map that describes the operation to execute under the :graphql key and a function to neatly unpack the data that results from that operation under the :unpack key. Unpacking reifies operations that were namespaced as a result of applying an operation mapping.

parse-document

macro

added in 0.1.0

(parse-document source)

Parses a GraphQL query string and emits an AST representation of the source as Clojure data.

parse-document

macro

added in 0.1.0

(parse-document source)

Parses a GraphQL query string and emits an AST representation of the source as Clojure data.

parse-document-files

macro

added in 0.1.0

(parse-document-files & files)

Parses GraphQL files and emits an AST representation of the source as Clojure data.

parse-document-files

macro

added in 0.1.0

(parse-document-files & files)

Parses GraphQL files and emits an AST representation of the source as Clojure data.

select

added in 0.1.0

(select doc data)(select doc data drop-unmatched?)

Given a query or fragment document and a map of data, select only the information in data that the document lists in its selection set.

with-mapping

added in 0.1.0

(with-mapping doc mapping)

Attaches an operation mapping to a document as meta data. An operation mapping maps a key to any named GraphQL operation within the document. Different keys can map to the same operation. When running an operation from the document, the operation mapping will be used to resolve multiple sets of variables based on the mapped key.