Tags:
- Admin GraphQL API
- Customer Account API
- Payments Apps API
- 2025-01
GraphQL Over HTTP
The handling of GraphQL requests via HTTP will evolve slightly as of 2025-01 API versions in accordance with the GraphQL over HTTP spec. These changes refine how a request's Content-Type and Accept headers work, and offer additional granularity in response status codes.
New response format
A new response format is available. Requests may select this format using the Accept header, for example:
The above favors receiving a response by listing it first. This new format is the same as JSON aside from its status codes:
- For
, this status indicates that the JSON payload was valid and that the submitted GraphQL document attempted execution on the server. Note that the response payload may still contain errors encountered during execution along with partial data. - For
, this status only indicates that the JSON payload was valid.
400 Bad Request
- For
, this status indicates that the JSON payload was invalid, or that the submitted GraphQL parameters failed static validation and were not executed. - For
, this status only indicates that the JSON payload was invalid.
Usage summary
For requests to 2025-01 versions and after:
- Use the
/graphqlendpoint. Using/graphql.jsonwill automatically respond withas it does now. - The request body must contain a spec JSON encoding.
- The
Content-Typeheader must specify. The legacyrequest format is no longer supported. Requests with no supported content type will receive a415 Unsupported Media Typeresponse. - The
Acceptheader now supportsand/orresponse formats. Requests with no supported accept types will receive a406 Not Acceptableresponse. - Accepting
*/*will default to aresponse.
These changes do NOT affect unstable versions at this time, or Storefront API. A breaking change announcement with migration timeline will be announced prior to any unstable transition.
Was this section helpful?