I’m hoping you can help me with an issue related to the variable used in a GraphQL request.
I loaded the GraphQL schema using introspection and created a variable for the collection to run tests. However, the variable is showing a null value in the query, which leads to a validation error: “Variable ‘propertyUid’ has coerced Null value for NonNull type ‘String!’”.
Any insights on what might be causing this or how to resolve it would be greatly appreciated!
Hi Danny, if I dont use the variable and add the value of the propertyUid directly in the query, it works, so I am having issue with how the variable is used in Postman
I’m not sure what’s happening there from that API - using our echo service I’m able to use a Collection level variable as a GraphQL Variable, which is resolved in the query
Hello ,
I tried it too, I am unable to reproduce the error, but I created a public collection, in case you want to make changes to it or compare it with the API you have - GraphQL request using variables
Also, I see in this screenshot that the Property object has two uids - one with String! and the other with String, that seems confusing, I’m not sure if that’s probably an issue. Could you try using the variable for another field? like say “name” and see if the problem still persists?
For future debugging purposes, I always look at the requests that were sent in the console. That way I can see what my variables are resolving to. The console shows all the sent requests along with the request/response bodies and headers. This would be worth checking out if you don’t hear from the API maintainer.
Another thing to check is if the property id you’re using exists in the system, it could just be an unfriendly “not found” error response