We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similar to the reference implementation: https://github.com/graphql/graphql-js/blob/c23f5782dee81b0a59a6a6bb2bcca9da247570e7/src/language/visitor.js#L72-L94
The text was updated successfully, but these errors were encountered:
7bebace
Here is an example of this feature. Here I just replace all variables with a constant:
import sangria.ast._ import sangria.visitor._ val query = gql""" query Foo($$aa: String = "some default", $$lang: String) { a: aaa(e: one) b: aaa(e: $$aa) { comments { # deeply nested name(lang: $$lang) ...Bar } } } fragment Bar on Comment { description(lang: $$lang) } """ val result = AstVisitor.visit(query, AstVisitor { case _: VariableDefinition ⇒ VisitorCommand.Delete case _: VariableValue ⇒ VisitorCommand.Transform(StringValue("some constant")) }) println(result.renderPretty)
result will look like this:
query Foo { a: aaa(e: one) b: aaa(e: "some constant") { comments { # deeply nested name(lang: "some constant") ...Bar } } } fragment Bar on Comment { description(lang: "some constant") }
/cc @timsuchanek
Sorry, something went wrong.
OlegIlyenko
No branches or pull requests
Similar to the reference implementation: https://github.com/graphql/graphql-js/blob/c23f5782dee81b0a59a6a6bb2bcca9da247570e7/src/language/visitor.js#L72-L94
The text was updated successfully, but these errors were encountered: