Add delete functionality for Metaobject Definitions#16
Open
Conversation
Implements the delete_metaobject_definition method to complete the CRUD operations for metaobject definitions management API. The method follows the same patterns as create and update methods, including proper error handling and logging. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new method to delete metaobject definitions via the Shopify GraphQL API.
- Adds method delete_metaobject_definition with pre-deletion checks
- Implements GraphQL deletion query with consistent error handling and performance logging
| end | ||
|
|
||
| # https://shopify.dev/docs/api/admin-graphql/2024-10/mutations/metaobjectDefinitionDelete | ||
| query = |
There was a problem hiding this comment.
[nitpick] Consider using a heredoc to define the multi-line GraphQL query for improved readability and easier maintenance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request extends the
ShopifyToolkit::MetaobjectStatementsmodule by adding the ability to delete metaobject definitions through the Shopify GraphQL API.New functionality for deleting Shopify metaobject definitions:
delete_metaobject_definition: Implements functionality to delete an existing metaobject definition by its type. The method includes built-in checks to skip deletion if the metaobject definition doesn't exist, providing user-friendly feedback. (lib/shopify_toolkit/metaobject_statements.rb)Key features:
metaobjectDefinitionDeleteGraphQL mutation from Shopify's Admin APIhandle_shopify_admin_client_errorsmethodlog_timedecorator for performance monitoringImplementation details:
get_metaobject_definition_gidmethod to check for metaobject existence