Skip to content
New issue

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

Parsing query with variables #106

Open
Maxim-CE opened this issue Oct 29, 2020 · 1 comment
Open

Parsing query with variables #106

Maxim-CE opened this issue Oct 29, 2020 · 1 comment

Comments

@Maxim-CE
Copy link

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.

@Liubasara
Copy link

same issue, any progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants