Skip to content

Bugfix-Release: Support multiple variable formats

Compare
Choose a tag to compare
@bwaidelich bwaidelich released this 01 Sep 09:51

BUGFIX: Support multiple variable formats

Previously the only format the HTTP endpoint support for
the variables is a JSON-serialized string:

{
    "query": "<some-query>",
    "variables": "{\"id\": \"123\"}"
    // ...
}

With this change, unserialized JSON objects are supported, too:

{
    "query": "<some-query>",
    "variables": {
       "id": "123"
    }
    // ...
}

Note: I couldn't find anything about this in the GraphQL spec.
The GraphiQL IDE sends the variables serialized, but other endpoints
seem to support both formats.