libgraphqlparser
libgraphqlparser copied to clipboard
Parsing query with variables
Is it possible to parse the query and use variables outside the actual query? For example, the following query is parsed correctly:
query Hero($episode: Episode, $withFriends: Boolean!) {
hero(episode: $episode) {
name
friends @include(if: $withFriends) {
name
}
}
}
However, I did not found a way to use those variables as part of the parsing process:
{
"episode": "JEDI",
"withFriends": false
}
In my understanding, the query has to be modified with those variables (use them as default variables in this query) in order for the string to be successfully parsed with "graphql_parse_string" function.
Thanks.
same issue, any progress?