# Problem getting data using GraphQL

**URL:** <https://community.appfarm.io/t/problem-getting-data-using-graphql/1964>\
**Category:** Ask the community\
**Tags:** web-request\
**Created:** [August 18, 2025, 7:47am UTC](https://community.appfarm.io/t/problem-getting-data-using-graphql/1964 "2025-08-18T07:47:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![frodeto](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@frodeto](https://community.appfarm.io/u/frodeto)\
**Post date:** [August 18, 2025, 7:47am UTC](https://community.appfarm.io/t/problem-getting-data-using-graphql/1964/1 "2025-08-18T07:47:48Z")

</div>

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:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/e/e8e984cdad82859436cfe0870c8afaee9a04a13b.png)

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!

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/b/b8c1852f3f180c63de38b802dbe32a8bfa937e8e.png)

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 18, 2025, 12:22pm UTC](https://community.appfarm.io/t/problem-getting-data-using-graphql/1964/2 "2025-08-18T12:22:11Z")

</div>

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](https://docs.appfarm.io/reference/data-model/graphql/queries#run-graphql-queries-from-appfarm)). 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?

---

<div class="post-metadata">

**Author:** ![frodeto](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@frodeto](https://community.appfarm.io/u/frodeto)\
**Post date:** [August 19, 2025, 9:55am UTC](https://community.appfarm.io/t/problem-getting-data-using-graphql/1964/3 "2025-08-19T09:55:34Z")

</div>

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 } } }”

}

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 19, 2025, 9:58am UTC](https://community.appfarm.io/t/problem-getting-data-using-graphql/1964/4 "2025-08-19T09:58:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![frodeto](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@frodeto](https://community.appfarm.io/u/frodeto)\
**Post date:** [August 19, 2025, 10:11am UTC](https://community.appfarm.io/t/problem-getting-data-using-graphql/1964/5 "2025-08-19T10:11:31Z")

</div>

The query behind the scene is probably the cause. It’s working in Postman with both GET and POST
