Skip to content

Parsing query with variables #106

Open
@Maxim-CE

Description

@Maxim-CE

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.

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