postman-collection icon indicating copy to clipboard operation
postman-collection copied to clipboard

Collection cannot understand {{key}} inside a JSON data file when running GraphQL request

Open hungdao-testing opened this issue 4 years ago • 0 comments

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)

hungdao-testing avatar Feb 07 '20 04:02 hungdao-testing