cancel
Showing results for 
Search instead for 
Did you mean: 

GraphQl request : extra quotes added to the Query Variables when the QUery Variables is a property

_Oliver_
Occasional Contributor

GraphQl request : extra quotes added to the Query Variables when the QUery Variables is a property

Hi all,

I am using ReadyApi 3.7.0 to perform a graphQl query using the integrated GraphQl Query function.

If I write the following on the Query Variables field :

{"testId": "{ABCDEF}"}

Then the query that is actually sent is correct and works fine. We have this in the sent query :

"variables":{"testId":"{ABCDEF}"}

 

Now, I want to use a property in the Query Variables field. I have defined a queryVar property and its content is exactly 

{"testId": "{ABCDEF}"}

And the content of the Query Variables field is now

${#TestSuite#queryVar)

But when I do that, I see that extra quotes are added at the beginning and at the end of the query variable value which is actually sent :

"variables":"{"testId": "{ABCDEF}"}"

(extra quotes in red)

I have no idea where this comes from. For test purpose, I have copied/pasted the value from the Query Variables field to the property value field, and I have also tried to write this property value with a groovy script, and the issue is the same 🤔

Any hint would be more than welcome.

 

Thanks

 

 

5 REPLIES 5
nmrao
Community Hero

Re: GraphQl request : extra quotes added to the Query Variables when the QUery Variables is a proper

Attach screen shot or simple project please? so that it would he easy to understand the issue?

Note that the value in custom property is always read as String. In case you need it differently, then it has to be parsed accordingly.


Regards,
Rao.
_Oliver_
Occasional Contributor

Re: GraphQl request : extra quotes added to the Query Variables when the QUery Variables is a proper

At first I set the value of the Query Variables field in the Query Var field

At first, it is defined like thisAt first, it is defined like this

 

Here is what is sent, this is correct The syntax in the query that is sent is okThe syntax in the query that is sent is ok

 

Then I put the exact same string in a property

 

Then I put this exact same string in a propertyThen I put this exact same string in a property

 

And I call this property in the Query Variables field

I call this property in the Query Variables fieldI call this property in the Query Variables field

 

The error is here : extra quotes are being added in the query which is sent

Extra quotes are added in the query that is sentExtra quotes are added in the query that is sent

_Oliver_
Occasional Contributor

Re: GraphQl request : extra quotes added to the Query Variables when the QUery Variables is a proper

Hi all,

 

Any hint ?

 

Thank you !

 

nmrao
Community Hero

Re: GraphQl request : extra quotes added to the Query Variables when the QUery Variables is a proper

Is it a json response?
Never seen such screen.


Regards,
Rao.
_Oliver_
Occasional Contributor

Re: GraphQl request : extra quotes added to the Query Variables when the QUery Variables is a proper

Hello nmrao,

 

Sorry, I am not sure what you mean by "jain response".

These are screen caps for the "graphQL Request window.

gql1.jpg

 

When a request is sent, the content of the sent request is visible in the "raw" tab. 

 

jql2.jpg

 

 

Does that answer your question ?

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors