Can't query anything with GraphQL

Can't query anything with GraphQL

russellbird
Visitor
2 0 0

I'm trying to query and update data in our Shopify store via GraphQL.  I can query the required objects such as Customers with the REST API, but I can't do this with GraphQL.  I've executed my basic query in GraphiQL on a demo store successfully, so I know the syntax I'm sending through is correct, but I always get a 404 Not Found response. 

 

I'm led to believe that there could be a problem with the store itself, but Shopify Support can't seem to help me in regard.  I only want to use GraphQL because it is more efficient to achieve what I'm after and because I don't seem to be able to update MetaFields via REST, although I can query them in REST (not in GraphQL).  Since REST and GraphQL share scopes for Developed Apps, I'm lost as to why I can't query any data using GraphQL.

 

If anyone has any ideas, I'd appreciate it.

Replies 3 (3)

BiDeal-Discount
Shopify Partner
539 58 127

Hi @russellbird 

can you screenshot your Graphql query by any tools like Postman or Insomnia?

- Helpful? Like & Accept solution!
- BiDeal Bundle Volume Discounts: Upsell with discount bundles, quantity breaks, volume discounts & mix-and-match bundles. AOV+ with free gifts, free shipping & progressive cart
- Bify app: Shopify automatic discount solutions
- Contact me? support@bify.app or WhatsApp: +84974709330
russellbird
Visitor
2 0 0

Hi,

 

I'm sending:

 

{
"query": "query getCustomer($id: ID!) { customer(id: $id) { id email firstName lastName createdAt updatedAt } }",
"variables": {
"id": "gid://shopify/Customer/XXXXXXXXXXXXXXX"
}
}
 
I've removed the Customer Record ID from the above. 
 
I'm sending a POST request to /admin/api/2025-04/graphql.json with the X-Shopify-Access-Token header set to my key.  My understanding is that this should behave the same as a GET request to admin/api/2024-10/customers/XXXXXXXXXXXX.json, which works. On the POST request to graphql I get 404 returned.
BiDeal-Discount
Shopify Partner
539 58 127

for Post request, did you accept the scope for your API?

BiDealDiscount_0-1747034913162.png

 

- Helpful? Like & Accept solution!
- BiDeal Bundle Volume Discounts: Upsell with discount bundles, quantity breaks, volume discounts & mix-and-match bundles. AOV+ with free gifts, free shipping & progressive cart
- Bify app: Shopify automatic discount solutions
- Contact me? support@bify.app or WhatsApp: +84974709330