shopify_app: Webhooks throwing error when deserializing admin_graphql_api_id
We started to receive webhook data including the new admin_graphql_api_id attribute today. This has a value of something akin to gid://shopify/Customer/61476333152.
The default WebhooksController is serializing the entire hash into the job request. When ActiveJob tries to deserialize the object, it’s looking at these gid’s and trying to deserialize them into ActiveRecord objects. Since these objects don’t exist on our system, we get an ActiveJob::DeserializationError.
I think I can work around this by creating a custom WebhooksController that deletes all of the admin_graphql_api_id attributes, but I’d like to see a more long-term fix in shopify_app.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 28 (11 by maintainers)
I ended up filtering out all of the Global IDs from the webhook data for now.
I think you could combine two strategies like this:
Then the class will exist, but locator should just return the string back.
I’m going to close this issue for now as we’re no longer including this field for new webhooks since yesterday around ~7 PM EST (23:00 UTC).
The
admin_graphql_api_idfields still exist in REST responses. They were added to help with interop/migration with our new Admin GraphQL API.For consistency (and usefulness), they will ideally be included in webhooks again soon once we come up with a solution. This will likely involve having to update to a newer version of this gem though.
@eapache If this field will be included again in the future can we get a bit more info on the timelines and recommended handling once available? Thanks.
this is the best short term @talecK
https://github.com/Shopify/shopify_app/issues/600#issuecomment-398163890