Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

Parsing query with variables #106

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.

Activity

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