7

I am having trouble with GraphQL queries made in python. It says that the signal $ that determine a variable in the query cannot be parsed.

Error message:

{"errors":[{"message":"Parse error on \"$\" (VAR_SIGN) at [3, 3]","locations":[{"line":3,"column":3}]}]}

Is there other way to use variables in this kind of request?

Here is my query, I didn't paste the fragment because I think it's not the problem

    query ApplicationIndexQuery(
  $status: Boolean!
  $page: Int
  $perPage: Int
  $filters: ApplicationFilter
  $sort: String
) {
  allOpportunityApplication(page: $page, per_page: $perPage, filters: $filters, sort: $sort) {
    ...ApplicationList_list
  }
}

variables = {

    "status": True,
    "page": 1,
    "perPage": 517,
    "filters": {
        "date_realized": {
            "from": "2018-12-01",
            "to": "2019-03-31"
        },
        "person_home_mc": 1535,
        "programmes": 5
    }

1 Answer 1

8

query should be at the top level, but it seems like in your example it's enclosed in curly braces. See below: https://github.com/apollographql/graphql-tag/issues/180#issuecomment-386540792

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.