Skip to content

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Mar 17, 2025

Resolves #15914

Summary by CodeRabbit

  • Chores

    • Updated version numbers across numerous modules and the overall package.
  • Bug Fixes

    • Enhanced error handling in actions such as customer creation, order processing, and customer updates to improve error reporting.
  • Refactor

    • Streamlined the product update process by removing legacy variant handling to simplify input processing.
    • Renamed properties in various modules to align with updated naming conventions.

Copy link

vercel bot commented Mar 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Mar 18, 2025 4:07pm
pipedream-docs ⬜️ Ignored (Inspect) Mar 18, 2025 4:07pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Mar 18, 2025 4:07pm

Copy link
Contributor

coderabbitai bot commented Mar 17, 2025

Walkthrough

This pull request primarily updates version numbers in numerous Shopify Developer App modules while making minor adjustments. Several action files now include enhanced error handling by checking for user errors within API responses before proceeding. Additionally, the GraphQL queries have been modified by removing the pagination parameter for metafields, and specific property names have been updated in source modules to reflect newer naming conventions.

Changes

File(s) Change Summary
components/shopify_developer_app/actions/{add-product-to-custom-collection, add-tags, create-article, create-blog, create-custom-collection, create-metafield, create-metaobject, create-page, create-product-variant, create-product, create-smart-collection, delete-article, delete-blog, delete-metafield, delete-page, get-articles, get-metafields, get-metaobjects, get-order, get-pages, search-custom-collection-by-name, search-customers, search-product-variant, search-products, update-article, update-inventory-level, update-metafield, update-metaobject, update-page, update-product-variant} Version numbers incremented by one minor release; no functional changes.
components/shopify_developer_app/actions/{create-customer, create-order, update-customer, update-product} Version updates with added error handling in the run method (checks for user errors). Additionally, update-product removes the variants property and its related processing logic.
components/shopify_developer_app/common/queries.mjs Removed the after argument from metafields queries to adjust pagination.
components/shopify_developer_app/package.json Package version updated from 0.7.0 to 0.7.1.
components/shopify_developer_app/sources/{new-abandoned-cart, new-article, new-cancelled-order, new-customer-created, new-draft-order, new-event-emitted, new-fulfillment-event, new-order-created, new-order-fulfilled, new-page, new-paid-order, new-product-created, new-product-updated, new-refund-created, new-updated-customer, new-updated-order, product-added-to-custom-collection} Version increments alongside property name adjustments in metadata generation (e.g. updatedAtupdated_at, createdAtcreated_at). Additionally, in one module the shopify key in the props object is renamed to app.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Action
    participant API
    Caller->>Action: Execute run() method
    Action->>API: Initiate API request
    API-->>Action: Return response (data & userErrors)
    alt userErrors present
        Action->>Action: Check errors and throw first error message
    else No errors
        Action->>Caller: Return successful response
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Update Shopify Developer App to leverage new GraphQL API (#15914)

Suggested labels

User submitted

Suggested reviewers

  • GTFalcao

Poem

I'm a bunny hopping with code so light,
Updating versions by day and night.
Errors are caught with a careful glance,
And queries now have a slimmer stance.
Hoppy and keen, I celebrate the change—
In our code garden, nothing's out of range!
🐰💻

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/shopify_developer_app/actions/update-product/update-product.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7723d78 and b415ab9.

📒 Files selected for processing (1)
  • components/shopify_developer_app/actions/update-product/update-product.mjs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (5)
components/shopify_developer_app/actions/update-product/update-product.mjs (5)

9-9: Version increment looks good.

The version has been properly incremented from 0.0.6 to 0.0.7, reflecting the changes made to this component.


95-107: The args structure is now more streamlined.

The input object now correctly includes the product ID directly, which aligns with the Shopify GraphQL API requirements for the productUpdate mutation.


109-119: SEO property handling has been fixed.

The code now correctly handles SEO properties by:

  1. Creating the SEO object with the title when provided
  2. Preserving any existing SEO properties when adding the description

This fixes the previous issue where the title would be overwritten when both properties were provided.


121-126: Media handling looks appropriate.

The images are now properly mapped to the media format required by Shopify's API, specifying both the source and content type.


128-132: Error handling has been improved.

The code now properly checks for user errors in the API response before proceeding, which is a good practice. This helps provide clearer error messages to the user when something goes wrong with the product update.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@michelle0927 michelle0927 marked this pull request as ready for review March 17, 2025 16:33
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
components/shopify_developer_app/actions/update-product-variant/update-product-variant.mjs (1)

14-14: Version Increment & Property Adjustment in Update Product Variant

The version has been bumped to "0.0.8", and the removal of the variants property (as described) should be cross-checked with any dependent logic. Additionally, the enhanced error handling introduced in this module is a positive improvement. Make sure that any references to the variants property in other parts of the code are updated accordingly.

components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs (1)

19-20: Consider standardizing property naming convention.

While this file keeps using the property name shopify, other components like product-added-to-custom-collection.mjs have renamed this property to app. Consider standardizing this naming convention across all components for better consistency.

  props: {
-   shopify,
+   app: shopify,
    ...props,
  },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0edb4b and 9d1f228.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs (1 hunks)
  • components/shopify_developer_app/actions/add-tags/add-tags.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-article/create-article.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-blog/create-blog.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-customer/create-customer.mjs (2 hunks)
  • components/shopify_developer_app/actions/create-metafield/create-metafield.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-order/create-order.mjs (2 hunks)
  • components/shopify_developer_app/actions/create-page/create-page.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-product-variant/create-product-variant.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-product/create-product.mjs (1 hunks)
  • components/shopify_developer_app/actions/create-smart-collection/create-smart-collection.mjs (1 hunks)
  • components/shopify_developer_app/actions/delete-article/delete-article.mjs (1 hunks)
  • components/shopify_developer_app/actions/delete-blog/delete-blog.mjs (1 hunks)
  • components/shopify_developer_app/actions/delete-metafield/delete-metafield.mjs (1 hunks)
  • components/shopify_developer_app/actions/delete-page/delete-page.mjs (1 hunks)
  • components/shopify_developer_app/actions/get-articles/get-articles.mjs (1 hunks)
  • components/shopify_developer_app/actions/get-metafields/get-metafields.mjs (1 hunks)
  • components/shopify_developer_app/actions/get-metaobjects/get-metaobjects.mjs (1 hunks)
  • components/shopify_developer_app/actions/get-order/get-order.mjs (1 hunks)
  • components/shopify_developer_app/actions/get-pages/get-pages.mjs (1 hunks)
  • components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs (1 hunks)
  • components/shopify_developer_app/actions/search-customers/search-customers.mjs (1 hunks)
  • components/shopify_developer_app/actions/search-product-variant/search-product-variant.mjs (1 hunks)
  • components/shopify_developer_app/actions/search-products/search-products.mjs (1 hunks)
  • components/shopify_developer_app/actions/update-article/update-article.mjs (1 hunks)
  • components/shopify_developer_app/actions/update-customer/update-customer.mjs (2 hunks)
  • components/shopify_developer_app/actions/update-inventory-level/update-inventory-level.mjs (1 hunks)
  • components/shopify_developer_app/actions/update-metafield/update-metafield.mjs (1 hunks)
  • components/shopify_developer_app/actions/update-metaobject/update-metaobject.mjs (1 hunks)
  • components/shopify_developer_app/actions/update-page/update-page.mjs (1 hunks)
  • components/shopify_developer_app/actions/update-product-variant/update-product-variant.mjs (1 hunks)
  • components/shopify_developer_app/actions/update-product/update-product.mjs (2 hunks)
  • components/shopify_developer_app/common/queries.mjs (3 hunks)
  • components/shopify_developer_app/package.json (1 hunks)
  • components/shopify_developer_app/sources/new-abandoned-cart/new-abandoned-cart.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-article/new-article.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-cancelled-order/new-cancelled-order.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-customer-created/new-customer-created.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-draft-order/new-draft-order.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-event-emitted/new-event-emitted.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-fulfillment-event/new-fulfillment-event.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-order-created/new-order-created.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-order-fulfilled/new-order-fulfilled.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-page/new-page.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-paid-order/new-paid-order.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-product-created/new-product-created.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-product-updated/new-product-updated.mjs (2 hunks)
  • components/shopify_developer_app/sources/new-refund-created/new-refund-created.mjs (2 hunks)
  • components/shopify_developer_app/sources/new-updated-customer/new-updated-customer.mjs (1 hunks)
  • components/shopify_developer_app/sources/new-updated-order/new-updated-order.mjs (1 hunks)
  • components/shopify_developer_app/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs (1 hunks)
🔇 Additional comments (70)
components/shopify_developer_app/sources/new-abandoned-cart/new-abandoned-cart.mjs (1)

14-14: Version updated appropriately.

Version bump from "0.0.6" to "0.0.7" aligns with the coordinated versioning update across multiple Shopify Developer App modules in this PR.

components/shopify_developer_app/sources/new-page/new-page.mjs (1)

14-14: Version updated appropriately.

Version bump from "0.0.5" to "0.0.6" is consistent with the versioning updates being applied across multiple modules in this PR.

components/shopify_developer_app/sources/new-refund-created/new-refund-created.mjs (2)

8-8: Version updated appropriately.

Version bump from "0.0.6" to "0.0.7" is consistent with the versioning updates being applied across multiple modules in this PR.


17-17: Property name corrected to match API response format.

Good change from camelCase createdAt to snake_case created_at, which aligns with Shopify's API response format for timestamps. This ensures proper timestamp parsing for event metadata generation.

components/shopify_developer_app/sources/new-fulfillment-event/new-fulfillment-event.mjs (2)

9-9: Version updated appropriately.

Version bump from "0.0.7" to "0.0.8" is consistent with the versioning updates being applied across multiple modules in this PR.


17-17: Property name corrected to match API response format.

Good change from camelCase updatedAt to snake_case updated_at, which aligns with Shopify's API response format for timestamps. This ensures proper timestamp parsing for event metadata generation and is consistent with similar changes in other files.

components/shopify_developer_app/sources/new-product-created/new-product-created.mjs (2)

9-9: Version number increment correctly applied.

The version number has been correctly updated from "0.0.9" to "0.0.10" to reflect the changes made in this update.


17-17: Property name updated to match Shopify API format.

The property name has been changed from createdAt (camelCase) to created_at (snake_case), which correctly aligns with Shopify's REST API response format. This ensures proper timestamp parsing.

components/shopify_developer_app/sources/new-draft-order/new-draft-order.mjs (2)

9-9: Version number increment correctly applied.

The version number has been properly updated from "0.0.9" to "0.0.10" to reflect the changes made in this update.


17-17: Property name updated to match Shopify API format.

The property name has been changed from createdAt (camelCase) to created_at (snake_case), which correctly aligns with Shopify's REST API response format. This ensures proper timestamp parsing.

components/shopify_developer_app/sources/new-paid-order/new-paid-order.mjs (2)

9-9: Version number increment correctly applied.

The version number has been properly updated from "0.0.9" to "0.0.10" to reflect the changes made in this update.


17-17: Property name updated to match Shopify API format.

The property name has been changed from updatedAt (camelCase) to updated_at (snake_case), which correctly aligns with Shopify's REST API response format. This ensures proper timestamp parsing for paid order events.

components/shopify_developer_app/sources/new-customer-created/new-customer-created.mjs (2)

9-9: Version number increment correctly applied.

The version number has been properly updated from "0.0.9" to "0.0.10" to reflect the changes made in this update.


17-17: Property name updated to match Shopify API format.

The property name has been changed from createdAt (camelCase) to created_at (snake_case), which correctly aligns with Shopify's REST API response format. This ensures proper timestamp parsing.

components/shopify_developer_app/sources/new-cancelled-order/new-cancelled-order.mjs (2)

9-9: Version update for consistency

The version has been correctly incremented from 0.0.9 to 0.0.10, maintaining consistency with other Shopify Developer App modules in this PR.


17-17: Property name updated to match Shopify's API response format

Changed from updatedAt to updated_at to properly match Shopify's API response format which uses snake_case rather than camelCase for property names.

components/shopify_developer_app/sources/new-updated-order/new-updated-order.mjs (2)

9-9: Version update for consistency

The version has been correctly incremented from 0.0.9 to 0.0.10, maintaining consistency with other Shopify Developer App modules in this PR.


17-17: Property name updated to match Shopify's API response format

Changed from updatedAt to updated_at to properly match Shopify's API response format which uses snake_case rather than camelCase for property names.

components/shopify_developer_app/sources/new-order-fulfilled/new-order-fulfilled.mjs (2)

9-9: Version update for consistency

The version has been correctly incremented from 0.0.6 to 0.0.7, maintaining consistency with the versioning pattern of other Shopify Developer App modules in this PR.


17-17: Property name updated to match Shopify's API response format

Changed from updatedAt to updated_at to properly match Shopify's API response format which uses snake_case rather than camelCase for property names.

components/shopify_developer_app/sources/new-updated-customer/new-updated-customer.mjs (2)

9-9: Version update for consistency

The version has been correctly incremented from 0.0.9 to 0.0.10, maintaining consistency with other Shopify Developer App modules in this PR.


17-17: Property name updated to match Shopify's API response format

Changed from updatedAt to updated_at to properly match Shopify's API response format which uses snake_case rather than camelCase for property names.

components/shopify_developer_app/common/queries.mjs (1)

112-112:

❓ Verification inconclusive

Pagination parameter removed from metafields query

You've removed the after parameter from the metafields query in the LIST_ORDERS GraphQL query. This change affects pagination capabilities, limiting the metafields retrieval to only the first batch specified by $first without the ability to fetch subsequent pages.

If this is intentional (perhaps due to API changes or performance considerations), please ensure that:

  1. The implementation that consumes this query is updated accordingly
  2. There's proper handling in case the number of metafields exceeds the limit set by $first

🏁 Script executed:

#!/bin/bash
# Check if there are any references to metafield pagination in the codebase
echo "Checking for metafield pagination usage..."
rg -i "metafields.*after" --type js components/shopify_developer_app/

Length of output: 166


Action Required: Verify Consumer Impact of Removed Pagination Parameter

The shell search for references to a pagination “after” parameter in the shopify_developer_app component did not return any results. However, since the output is inconclusive, please manually verify that the removal of the after parameter from the metafields query in components/shopify_developer_app/common/queries.mjs was intentional and that the consuming implementation has been updated accordingly. In particular:

  • Confirm that no downstream code assumes pagination support beyond the initial $first batch.
  • Verify that there’s proper handling in cases where the total number of metafields exceeds the limit specified by $first.
components/shopify_developer_app/sources/new-order-created/new-order-created.mjs (2)

9-9: Version number incremented appropriately

Version bump from 0.0.9 to 0.0.10 is appropriate for the changes made in this file.


17-17: Property name updated to match Shopify API format

You've updated the property name from createdAt to created_at, which aligns with Shopify's API response format. This change fixes a potential bug where timestamp information wouldn't be properly accessed.

components/shopify_developer_app/package.json (1)

3-3: Package version updated correctly

The version increment from 0.7.0 to 0.7.1 follows semantic versioning principles for minor changes, which is appropriate for the modifications made across the component files.

components/shopify_developer_app/actions/get-articles/get-articles.mjs (1)

14-14: Version number incremented appropriately

Version bump from 0.0.7 to 0.0.8 is consistent with the versioning updates throughout the PR.

components/shopify_developer_app/actions/get-pages/get-pages.mjs (1)

14-14: Version Number Update:
The version string has been updated to "0.0.8", which aligns consistently with the coordinated release effort across similar modules in the Shopify Developer App.

components/shopify_developer_app/actions/delete-page/delete-page.mjs (1)

14-14: Version Number Update:
The version has been incremented to "0.0.8", reflecting the standardized versioning across related actions. No further changes are needed.

components/shopify_developer_app/actions/create-article/create-article.mjs (1)

14-14: Version Number Update:
The updated version "0.0.8" is consistent with the recent changes across similar modules. This update is straightforward and well executed.

components/shopify_developer_app/actions/update-metaobject/update-metaobject.mjs (1)

14-14: Version Number Update:
The version is updated to "0.0.9", reflecting an incremental change compared to the previous "0.0.8". This consistency in version management is commendable.

components/shopify_developer_app/actions/delete-article/delete-article.mjs (1)

14-14: Version Number Update:
The export’s version has been updated to "0.0.8", ensuring parity with other deletion-related modules in the app. The update is minimal and appropriate.

components/shopify_developer_app/actions/get-order/get-order.mjs (1)

8-8: Version Bump Confirmation
The version is updated to "0.0.4", which aligns with the coordinated versioning strategy across the Shopify Developer App modules. Please verify that this update is intentional and consistent with your release process.

components/shopify_developer_app/actions/create-product-variant/create-product-variant.mjs (1)

14-14: Version Update Verification
The version has been updated to "0.0.7". Ensure that any downstream integrations referencing this module are updated accordingly.

components/shopify_developer_app/actions/search-customers/search-customers.mjs (1)

7-7: Consistent Version Increment
The version is now set to "0.0.6", in keeping with the other modules in the project. This change appears straightforward—please confirm that no other logic was meant to be adjusted.

components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs (1)

14-14: Version Number Update
The exported version is now "0.0.8". This update is in line with the overall module versioning approach. Just double-check that any documentation referencing the old version is updated, if applicable.

components/shopify_developer_app/actions/add-tags/add-tags.mjs (1)

14-14: Version Increment Confirmation
The version has been incremented to "0.0.6", matching the scheme used in related modules. Everything looks consistent with the PR objectives regarding version updates.

components/shopify_developer_app/actions/create-blog/create-blog.mjs (1)

14-14: Version Update Validated.
The version number has been correctly updated to "0.0.8" in this module, which is consistent with the coordinated version bump across related Shopify Developer App actions.

components/shopify_developer_app/actions/delete-blog/delete-blog.mjs (1)

14-14: Version Update Confirmed.
The export’s version has been incremented to "0.0.8", ensuring consistency with similar modules in the PR.

components/shopify_developer_app/sources/new-event-emitted/new-event-emitted.mjs (1)

10-10: Version Increment Verified.
The source module’s version has been updated to "0.0.11", aligning with the overall versioning strategy applied in this update.

components/shopify_developer_app/actions/create-product/create-product.mjs (1)

14-14: Proper Version Bump.
The module version has been increased to "0.0.6", which is in line with the standardized updates across other product-related actions.

components/shopify_developer_app/actions/update-page/update-page.mjs (1)

14-14: Version Update Verified.
The updated version "0.0.8" is correctly applied here, matching the versioning updates seen in other similar modules of the Shopify Developer App.

components/shopify_developer_app/actions/create-page/create-page.mjs (1)

14-14: Version Update: Create-Page Action.
The version has been updated to "0.0.8", which is in line with the coordinated release bump across similar modules. No functional changes are present here.

components/shopify_developer_app/actions/update-article/update-article.mjs (1)

14-14: Version Update: Update-Article Action.
The version number is updated to "0.0.8"—a straightforward version bump that ensures consistency with the overall release cycle for the Shopify Developer App.

components/shopify_developer_app/actions/get-metaobjects/get-metaobjects.mjs (1)

14-14: Version Update: Get-Metaobjects Action.
The version number has been incremented to "0.0.7". This change is simple and consistent with similar version updates in the project.

components/shopify_developer_app/sources/new-article/new-article.mjs (1)

14-14: Version Update: New-Article Source.
The version is now set to "0.0.6", matching the new release cycle as implemented in other related modules. This maintains consistency across the codebase.

components/shopify_developer_app/actions/delete-metafield/delete-metafield.mjs (1)

12-12: Version Update: Delete-Metafield Action.
The version number has been bumped to "0.0.7". The update is straightforward and aligns well with the coordinated version changes observed across other modules in this PR.

components/shopify_developer_app/actions/get-metafields/get-metafields.mjs (1)

11-11: Version Update Verification in Get Metafields Module

The version update to "0.0.7" is correctly applied. Since this change is purely for versioning, ensure that any downstream integrations or consumers are informed, though no functional changes are introduced here.

components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs (1)

14-14: Version Bump Confirmation in Create Custom Collection

The version number has been updated to "0.0.6" as expected. The change is isolated to versioning without affecting the behavior or structure of the module, maintaining consistency with the coordinated update strategy.

components/shopify_developer_app/actions/search-product-variant/search-product-variant.mjs (1)

14-14: Consistent Version Update in Search Product Variant Module

The version update to "0.0.6" is consistently applied. The changes are isolated to versioning and do not affect the overall functionality of the module.

components/shopify_developer_app/actions/update-inventory-level/update-inventory-level.mjs (1)

14-14: Unified Version Bump in Update Inventory Level Module

The version change to "0.0.6" aligns with the coordinated update strategy across the Shopify Developer App modules. No additional modifications or logic changes are present here, ensuring smooth integration.

components/shopify_developer_app/actions/update-metafield/update-metafield.mjs (1)

12-12: Version Bump Verification for update-metafield.mjs
The version update from the previous version to "0.0.7" is appropriately applied here. This change is purely cosmetic and aligns with the coordinated version upgrades across the Shopify Developer App modules.

components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs (1)

14-14: Version Increment Update to "0.0.6"
The version bump in this file is correctly updated and consistent with the overall release cycle. No functionality is affected by this change.

components/shopify_developer_app/actions/search-products/search-products.mjs (1)

14-14: Simple Version Upgrade to "0.0.6"
This update is a straightforward version change with no impact on the underlying logic. The change maintains consistency across similar modules.

components/shopify_developer_app/actions/create-smart-collection/create-smart-collection.mjs (1)

14-14: Version Update to "0.0.6" Maintained
The version bump here follows the established pattern seen in other modules in this PR. There are no additional modifications to functionality, so the update is safe and clear.

components/shopify_developer_app/actions/create-metafield/create-metafield.mjs (1)

13-13: Version Bump to "0.0.7" Confirmed
The version increment from "0.0.6" to "0.0.7" is correctly applied. This change does not affect the logic or operation of the module and adheres to the coordinated versioning strategy across the project.

components/shopify_developer_app/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs (2)

14-14: Version update looks good.

Properly incremented version number from "0.0.5" to "0.0.6", which is consistent with version updates across other Shopify Developer App components.


19-19: Property name change from shopify to app is appropriate.

This change reflects a move toward more generic naming conventions, making the code more maintainable. This abstraction decouples the component interface from specific implementation details.

components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs (1)

14-14: Version update looks good.

Properly incremented version number from "0.0.5" to "0.0.6" as part of the coordinated version bump across Shopify Developer App components.

components/shopify_developer_app/sources/new-product-updated/new-product-updated.mjs (2)

8-8: Version update looks good.

Version increment from "0.0.7" to "0.0.8" follows the coordinated versioning strategy for Shopify Developer App components, though with a different version sequence.


46-46: Property name change improves API compatibility.

Changing from resource.updatedAt to resource.updated_at aligns with Shopify API's snake_case naming convention, fixing a potential bug where the code was trying to access a non-existent property due to incorrect casing.

components/shopify_developer_app/actions/create-order/create-order.mjs (2)

8-8: Version update looks good.

Properly incremented version number from "0.0.5" to "0.0.6" as part of the coordinated version bump across Shopify Developer App components.


157-159: Excellent addition of error handling.

This change greatly improves the robustness of the code by checking for user errors in the API response. Throwing an error with the specific message from the API response provides better feedback for debugging and prevents silent failures.

components/shopify_developer_app/actions/update-customer/update-customer.mjs (2)

9-9: Version number updated appropriately.

Version has been incremented from 0.0.6 to 0.0.7, reflecting the changes in this PR.


110-112: Great addition of error handling.

Adding explicit error handling for Shopify's user errors improves the component's reliability. This change ensures that API-level validation errors are properly surfaced to the user rather than being silently ignored.

components/shopify_developer_app/actions/create-customer/create-customer.mjs (2)

7-7: Version number updated appropriately.

Version has been incremented from 0.0.5 to 0.0.6, reflecting the changes in this PR.


91-93: Great addition of error handling.

Adding explicit error handling for Shopify's user errors improves the component's reliability. This ensures that API-level validation errors are properly surfaced to the user rather than proceeding with potentially invalid data.

components/shopify_developer_app/actions/update-product/update-product.mjs (3)

10-10: Version number updated appropriately.

Version has been incremented from 0.0.6 to 0.0.7, reflecting the changes in this PR.


104-104: Explicit product ID assignment improvement.

Adding the explicit id field to the input object ensures the correct product is targeted for updates. This is a good practice for clarity and prevents potential issues.


119-122: Enhanced error handling and improved success message.

This change adds proper error handling for Shopify's user errors and improves the success message to include both the product title and ID. This makes debugging and user feedback more effective.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d1f228 and 7723d78.

📒 Files selected for processing (1)
  • components/shopify_developer_app/actions/update-product/update-product.mjs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (4)
components/shopify_developer_app/actions/update-product/update-product.mjs (4)

128-132: Good improvement in error handling.

The enhanced error handling is a positive change. Now the code properly checks for user errors in the API response before proceeding, which will provide better feedback to users when something goes wrong.


9-9: Version increment looks good.

The version update from 0.0.6 to 0.0.7 is appropriate given the changes in functionality.


95-107: Improved argument structure.

The updated structure with explicit ID specification is cleaner and more direct. This change improves the clarity of what's being passed to the API.


121-126:

❓ Verification inconclusive

Verify media property usage.

The property is named images in the props (line 54), but assigned to args.media here. Double-check that this is the expected behavior for the Shopify API.


🏁 Script executed:

#!/bin/bash
# Search for other usages of images/media to understand the expected pattern
echo "Searching for other image handling patterns in Shopify components..."
rg -A 3 "args.media" --type js components/shopify_developer_app/

echo "Checking Shopify GraphQL docs references..."
rg -A 3 "mediaContentType" --type js components/shopify_developer_app/

Length of output: 379


Attention: Confirm Shopify API Field Mapping

The current implementation transforms the component’s images prop into an args.media array—with each image being wrapped in an object containing originalSource and a hardcoded mediaContentType: "IMAGE". Our initial repository search did not reveal alternative usages of args.media or any patterns that would clarify its intended usage. This makes it important to verify manually that the Shopify API indeed expects a field named media (with this precise structure) rather than directly using the images property.

Please double-check the Shopify API documentation to ensure:

  • The API requires a parameter named media for updating product images.
  • Each media object should have a structure like { originalSource, mediaContentType: "IMAGE" }.

If the documentation indicates a different field name or structure (for instance, if the API expects images rather than media), kindly update the mapping accordingly.

@michelle0927 michelle0927 requested a review from jcortes March 19, 2025 14:14
@michelle0927
Copy link
Collaborator Author

/approve

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @michelle0927 lgtm! Ready for QA!

@michelle0927 michelle0927 merged commit 87b0e90 into master Mar 19, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-15914-2 branch March 19, 2025 15:36
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.

[FEATURE] Shopify Developer App - update to GraphQL API
2 participants