(com.walmartlabs.lacinia.parser.query/parse-query "{ id }")
=> [{:type :query, :selections [{:type :field, :field-name :id}]}]
There is a function inside lacinia that turns [{:type :query, :selections [{:type :field, :field-name :id}]}]
back to query { id }
?Why do you need to do that? What is your real problem/requirement?
I'm working on tools around #eql and #pathom and using eql ast
as "lingua franca". Alread translated GraphQL
into eql ast
. Now I want to turn eql ast
back to GraphQL
You can probably accomplish something with the preview apis, but there isn't a directly supported way of going backwards from a parsed query to the original query.
And the structure of a parsed query is internal, subject to change at any time (thus the need for the preview api).