Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for filters in webhook registration #1923

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

kennyadsl
Copy link
Contributor

What this PR does

To support passing a filter to webhook registrations, the filter parameter is needed.

Depends on Shopify/shopify-api-ruby#1347

Reviewer's guide to testing

gem "shopify_api", github: 'nebulab/shopify-api-ruby', branch: 'kennyadsl/add-filter-support'
gem "shopify_app", github: 'nebulab/shopify_app', branch: 'kennyadsl/add-filter-support'

The following registration won't work without the changes in the two PRs above, because apparently, to register a metaobject-related webhook, at least one filter needs to be specified.

ShopifyApp.configure do |config|
  config.webhooks = [
    {
      topic: "metaobjects/update",
      path: "api/webhooks/metaobjects_update",
      filter: "type:my_type OR type:my_other_type",
    },
  ]
end

Checklist

Before submitting the PR, please consider if any of the following are needed:

  • Update CHANGELOG.md if the changes would impact users
  • Update README.md, if appropriate.
  • Update any relevant pages in /docs, if necessary
  • For security fixes, the Disclosure Policy must be followed.

Copy link
Contributor

@matteodepalo matteodepalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for your contribution!

@matteodepalo
Copy link
Contributor

@kennyadsl could you update the shopify_api version to 14.7.0?

To support passing a filter to webhook registrations, the filter
parameter is needed.

Needs to update the shopify_api dependency to >= 14.7.0, which is the
first version of the api that includes the support to the filter
parameter.
@kennyadsl
Copy link
Contributor Author

@matteodepalo done!

@matteodepalo matteodepalo merged commit 8a8daf6 into Shopify:main Nov 28, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants