Hey there; we are experiencing a breaking change in graphql api version 2025-01
This works in 2024-10:
curl -X POST \
https://{shop}.myshopify.com/admin/api/2024-10/graphql.json \
-H 'Content-Type: application/graphql' \
-H 'X-Shopify-Access-Token: {password}' \
-d '{products(first: 10) {edges {node {id}}}}'
but fails on 2025-01 with {"errors":"Unsupported Content-Type header, use application\/json"}
I see in the release notes that there is now JSON body support; however I don’t see any mention that every request to the graphql api must be application/json going forward
This is breaking popular libraries such as Unsupported Content-Type header, use application/json 2025-01 · Issue #669 · MONEI/Shopify-api-node · GitHub
Is this a bug on Shopify’s end; or was this breaking change intentional
Hi Kyle,
I’ve connected with our internal teams who have confirmed that application/graphql
has never strictly been an allowed request
content-type header, however it looks like it was just accepted previously.
The response formats should be ‘application/graphql-response+json’ or ‘application/json’, with ‘application/graphql-response+json’ being preferred as it allows for status codes other than ‘200’.
The changelog for this in 2025-01
is here GraphQL Over HTTP — Shopify developer changelog
And info on the change limiting to json
is here: Content type `application/graphql` is deprecated — Shopify developer changelog
1 Like
Thanks for looking in to that!
At Gadget we use the release notes for each API version to determine which changes we need to make, i.e. 2025-01 release notes
Would be helpful if all breaking changes were rolled up into that
Good call - giving that feedback to our team!