Good Day,
Katalon Studio version: 8.4.0
Why I’m getting null response on the response if I have a variable?
query Payor($id : String){
insuranceCompanies(filter:{insuranceCompanyId:$id}){
id
insuranceCompanyId
name
}
}
{"id" : "APA09"}
While in GraphQL it is working and I’m able to query
And if I don’t use variable it is working also
query Payor{
insuranceCompanies(filter:{insuranceCompanyId:"APA09"}){
id
insuranceCompanyId
name
}
}
TIA!
1 Like
@Brylesu , in your Query table, you are missing the “!” in Payor($id:String)
. It is supposed to be Payor($id:String!)
. You can check the doc about GraphQL variables here .
Hi Chen
Still not working
query Payor($id : String!){
insuranceCompanies(filter:{insuranceCompanyId:$id}){
id
insuranceCompanyId
name
}
}
{"id" : "APA09"}
The link you provided is also my reference : GraphQL | Katalon Docs
But no luck getting a correct response
hiru
July 25, 2022, 10:14am
5
@Brylesu can I have the URL to reproduce to see myself? I’m kinda curious.
1 Like
Hi Hiru ,
sorry I cannot provide the url as the url is connected on my Project db
@Brylesu maybe the number of spaces could cause an error.
Try formatting it as Payor($id: String!)
with no space between $id
and :
.
If not, then it might be a bug on our side.
Brylesu:
{"id" : "APA09"}
Hi Chen Good Day!
Still not working if I tried the following:
query Payor($id:String!){
query Payor($id: String!){
@Brylesu , thank for testing it out. I could now conclude that it’s a bug on our side. I would bring up this bug report to the Product Team to investigate and update you with their answer.
1 Like
Thank you @chen.lee for the comprehensive support. Already submitted to our Product team and keep you posted @Brylesu .
1 Like
@Brylesu
I got an update from the Product Team, which said that you are not declaring the variable with the correct type. Variable id
does not belong to String, it could either be null or an Object type. You can refer to the screenshot they provided below for reference:
Hi Chen Thanks for the updated
But I used the variable id for Filtering purpose on this line so it should be String!
insuranceCompanies(filter:{insuranceCompanyId:$id}){
Also I tried the
query Payor($id: ID!){
insuranceCompanies(filter:{insuranceCompanyId:$id}){
id
insuranceCompanyId
name
}
}
It returns null value
Also check my GraphQL insruanceCompanyId type
Let’s me bring this up again with the Product Team and see the reason why.
Additional Info
I tried to replace $id
to $insuranceId
and got same output
Query
query Payor($insuranceId: String!){
insuranceCompanies(filter:{insuranceCompanyId:$insuranceId}){
id
insuranceCompanyId
name
}
}
Variable
{"$insuranceId" : "APA09"}
Result
Null response~
@Brylesu , try this to see what happens:
Query:-
query Payor($insuranceId: String){
insuranceCompanies(filter:{insuranceCompanyId:$insuranceId}){
id
insuranceCompanyId
name
}
}
Query Parameter:-
{
"insuranceId" : "APA09"
}
Hi Chen
Same output , got null response with your given script
@Brylesu , the Product team will re-investigate this issue again and I will update you on this.
2 Likes