shopify-api-js icon indicating copy to clipboard operation
shopify-api-js copied to clipboard

webhook format for GraphQL fields

Open mariusa opened this issue 2 years ago • 1 comments

Overview

For webhooks created via GraphQL, webhook data is still in REST format instead of https://shopify.dev/api/admin-graphql/2022-04/objects/Product#fields

eg product has created_at instead of createdAt, body_html instead of descriptionHtml, no media list (but has images)

Proposal: have a new format at WebhookSubscriptionFormat such as JSON_GRAPHQL, which will send webhooks data in format matching https://shopify.dev/api/admin-graphql/2022-04/objects/Product#fields

Type

  • [ ] New feature
  • [x] Changes to existing features

Motivation

What inspired this feature request? What problems were you facing?

Using GraphQL and being consistent in handling data

Area

  • [ ] Add any relevant Area: <area> labels to this issue

Checklist

  • [x] I have described this feature request in a way that is actionable (if possible)

mariusa avatar Mar 06 '22 09:03 mariusa

when do we expect this issue will be resolved? I need a media list on the webhook

hunght avatar Jun 08 '22 02:06 hunght

This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.

github-actions[bot] avatar Oct 06 '22 02:10 github-actions[bot]

not stale

mariusa avatar Oct 06 '22 06:10 mariusa

This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.

github-actions[bot] avatar Jan 31 '23 02:01 github-actions[bot]

not stale

mariusa avatar Jan 31 '23 16:01 mariusa

I desperately need this. Any update?

arobbins avatar Mar 15 '23 16:03 arobbins

This is not a limitation of the library but of the underlying GraphQL implementation.

To direct this feedback to the team supporting the WebhookSubscriptionFormat enum, please use the "Was this section helpful?" feedback mechanism under the Valid values section of WebhookSubscriptionFormat - that feedback mechanism directs a GitHub issue to the appropriate GraphQL API team for their review.

mkevinosullivan avatar Mar 21 '23 20:03 mkevinosullivan

Hi! I see this issue is quite old. Was anyone able to figure this out? I'm using graphQl to generate my pages using NextJS. However, when I trigger a webhook revalidation, the returned key for decription is description_html and not descriptionHtml like it is in graphQl. How can I handle this in my code?

MrUltimate avatar Feb 08 '24 00:02 MrUltimate