You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 25, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 25, 2024. It is now read-only.
Anyway to recreate the query from the parsed AST #102
Just looking through I can see that I can parse the AST with GraphProxy.Query, I just wondered if there was any way to recreate that query back from the AST to a string?
Lol sorry I copied the name of my module, I meant using GraphQL.Lang.Parser. I needed the functionality because I have to work on a GraphQL proxy that takes a single query and resolves to several GQL instances. I needed to parse the query, and change the AST to only send parts of the query to different instances, at which point I needed to re-stringify the AST.
Its and odd use case I appreciate and in the end I just wrote a simple module to do this, I cant think of any uses you might have for this, feel free to close this down.
@chrisjowen do you have this code available anywhere? I think I could use something similar to what you've made for implementing an ACL, implementing a subscriptions module on top of an existing GraphQL server, and split a query among different databases 😄
Activity
joshprice commentedon Aug 28, 2016
Hi!
There isn't a way right now to recreate the query from the AST. What would you use it for exactly?
Also not sure what GraphProxy.Query is, got a link?
chrisjowen commentedon Aug 30, 2016
Lol sorry I copied the name of my module, I meant using GraphQL.Lang.Parser. I needed the functionality because I have to work on a GraphQL proxy that takes a single query and resolves to several GQL instances. I needed to parse the query, and change the AST to only send parts of the query to different instances, at which point I needed to re-stringify the AST.
Its and odd use case I appreciate and in the end I just wrote a simple module to do this, I cant think of any uses you might have for this, feel free to close this down.
Cheers, Chris
sunny-g commentedon Sep 26, 2017
@chrisjowen do you have this code available anywhere? I think I could use something similar to what you've made for implementing an ACL, implementing a subscriptions module on top of an existing GraphQL server, and split a query among different databases 😄