graphql

souenzzo 2020-03-11T16:58:57.060700Z

(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 } ?

hlship 2020-03-11T18:09:28.061Z

Why do you need to do that? What is your real problem/requirement?

souenzzo 2020-03-11T19:05:48.067300Z

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

hlship 2020-03-11T19:07:54.067500Z

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.

hlship 2020-03-11T19:08:12.067700Z

And the structure of a parsed query is internal, subject to change at any time (thus the need for the preview api).