Forum Discussion

Ashwith's avatar
Ashwith
New Contributor
2 years ago

How to transfer entire json object from one response to another request?

How to use property expansion to set entire json object into new request from previous response?

I am currently testing graphql endpoints.
I am passing excel sheet with id's and using data source to read it  and then pass it into graphql request variables.
I am getting Json object as response in the format as 

 

 

{
 "data": {
     "QueryTemp" : [{
         "id":"1234",
         "Name": "TestData"
      }]
}

 

 

I want to use this response into query variable of another graphql request that performs mutation operation.

Currently I am using 

 

 

{
  "input" : ${my-first-gql-request#Response#$['data']['QueryTemp'][0]}
}

 

 

But, this is not working.
Please help me with this.

 

  • nmrao's avatar
    nmrao
    Champion Level 3

    Where did you use

    ${my-first-gql-request#Response#$['data']['QueryTemp'][0]}

     

    and what is it returning?

    • Ashwith's avatar
      Ashwith
      New Contributor

      I used this in my query variables like

      {
          "input": ${my-first-gql-request#Response#$['data']['QueryTemp'][0]}
      }