Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.
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

Open

Description

@chrisjowen

Hey there,

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?

Chris

Activity

  1. joshprice commented on Aug 28, 2016

    @joshprice
    Member

    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?

  2. chrisjowen commented on Aug 30, 2016

    @chrisjowen
    Author

    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

  3. sunny-g commented on Sep 26, 2017

    @sunny-g

    @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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions