postman-collection
postman-collection copied to clipboard
Collection cannot understand {{key}} inside a JSON data file when running GraphQL request
Precondition
There is a JSON data file,
[ { "test" : "data1", "expData": {//} }, { "test" : "data2", "expData": {//} }, ]
In the GraphQL variables, I pass the key {{test}}
but the result is failed. But in Pre-request script, I convert it into string and set into env variable, it okie
let testObj = pm.iterationData.get("test");
pm.environment.set("testObj", testObj)