Ask a Question

For graphql variables, data from the Grid, get serialize in to a string instead of json

tgkp
Established Member

For graphql variables, data from the Grid, get serialize in to a string instead of json

Hi,

 

I am facing an issue while passing variables to a graphql query. Variables are getting values from a Grid.

 

tgkp_0-1679135716841.png

 

But, while API call, both the variables get converted as string instead of json.

"variables" : "{\n \"name\" : \"abc\",\n \"age\" : 42\n}"

 

Getting error:

"message" : "`variables` in a POST body should be provided as an object, not a recursively JSON-encoded string.",

 

query variable used:

{
"name" : "${getNameAgeFromGrid#name}",
"age" : ${getNameAgeFromGrid#age}
}

 

Below variables options are working:

{
"name" : "${getNameAgeFromGrid#name}",
"age" : 42
}

 

and:

{
"name" : "abc",
"age" : 42
}

 

Is there any solution for this issue.

0 REPLIES 0
cancel
Showing results for 
Search instead for 
Did you mean: