Skip to content

Commit 03715a0

Browse files
lizkenyonclaude
andcommitted
Fix webhook registration for topics containing dots
Fixes an issue where webhook topics containing dots (e.g., customer.tags_added, customer.tags_removed) would fail to register with GraphQL syntax errors. The problem was an inconsistency in topic name normalization: - Registration.rb only replaced slashes with underscores - Registry.rb replaced both slashes and dots with underscores This caused GraphQL field name errors since dots are invalid in GraphQL field names. Updated the normalization in Registration.rb to match Registry.rb by replacing both slashes and dots with underscores. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 133611c commit 03715a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/shopify_api/webhooks/registration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Registration
3232
filter: T.nilable(String)).void
3333
end
3434
def initialize(topic:, path:, handler: nil, fields: nil, metafield_namespaces: nil, filter: nil)
35-
@topic = T.let(topic.gsub("/", "_").upcase, String)
35+
@topic = T.let(topic.gsub(%r{/|\.}, "_").upcase, String)
3636
@path = path
3737
@handler = handler
3838
fields_array = fields.is_a?(String) ? fields.split(FIELDS_DELIMITER) : fields

0 commit comments

Comments
 (0)