I’m trying to fetch data using a GraphQL query in Appfarm, but I’m stuck on how to structure the web request. I know the bearer token is valid, and the following query works perfectly in Postman:
However, I can’t seem to get it working in Appfarm. I’ve tried various combinations in the web request setup, but no luck so far.
Has anyone successfully made a GraphQL request in Appfarm? Any tips on how to structure the request body, headers, or other settings would be greatly appreciated!
Hi!
I have done it a few times, and in those cases it was pretty much like you have set it up (similar to this link). I can see that you have a few more Headers in Postman than in my setup when I try to connect from Postman. Could it be some headers that you have in Postman that have not been added to the Appfarm web request?
I found the solution, sent it as a POST, Body Type set to Raw and content set as this:
{
“query”: “query GetHubs { hubs { pagination { cursor } results { name id } } }”
}
Aha, nice. In Postman, is it a POST operation as well? I guess Postman creates that body with “query: ” behind the scenes, whereas the example in Appfarm documentation is towards a GraphQL GET endpoint using query parameters only.
The query behind the scene is probably the cause. It’s working in Postman with both GET and POST