简体   繁体   中英

How to send multiple query variables using GraphQL Playground

If I have one variable named $external and one named $manifest, which should be JSON, how do I define them both as query variables in the GraphQL Playground?

{
  "external": "name",
  "manifest": 
    {
    "some": "json",
    }
}

This gives me an error: Expected String but found }``.

Yes, I am on the query variables tab, something that has caught out many people asking about how to pass a single query variable.

Avoid trailing commas in JSON (line 5 and originally line 6 as well)

{
    "external": "name",
    "manifest": {
        "some": "json"
    }
}

is valid JSON

You can test your JSON using jsonlint

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM