GraphQL descriptionHtml vs Webhook API body_html

Topic summary

A developer is encountering a data format inconsistency between Shopify’s GraphQL API and Webhook API when building a Next.js eCommerce site with on-demand revalidation.

The Issue:

  • GraphQL API returns product descriptions using the key descriptionHtml
  • Webhook API returns the same data using the key body_html
  • This mismatch creates handling challenges when trying to automatically update content in Next.js based on Shopify changes

Developer’s Question:
Seeking solutions to either:

  • Handle this key naming inconsistency within Next.js
  • Configure the Webhook API to return object keys matching the GraphQL API format

The post includes screenshots comparing the response formats from both APIs. The discussion remains open with no resolution provided yet.

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

Hi,

I’m facing a weird issue with Shopify’s GraphQL API and the webhook API. I’m using NextJS to build my eCommerce site and that uses the GraphQL API to query for products. I am then trying to use on-demand revalidation so that when the client makes updates in Shopify, NextJS can automatically update it. Unfortunately, while the graphQL API has descriptionHtml the webhook API returns it as body_html.

Is there anyway to handle this in NextJS or get the webhook API to return object keys as how they appear in the GraphQL API?

GraphQL Response:

Webhook response: