Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Dec 8, 2025

WHY

Resolves #19331

Summary by CodeRabbit

  • New Features
    • Added actions to list and retrieve customers, draft orders, fulfillment orders (including assigned), search orders, and update orders; plus new app methods and selector props for common IDs.
  • Chores
    • Bumped package version and updated many action/source module versions across the Shopify integration.

✏️ Tip: You can customize this high-level summary in your review settings.

@jcortes jcortes self-assigned this Dec 8, 2025
@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Dec 12, 2025 4:40pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Dec 12, 2025 4:40pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Walkthrough

Adds many new Shopify actions (get/list/update for orders, draft orders, customers, fulfillment orders), new GraphQL queries and an UPDATE_ORDER mutation, new app propDefinitions/methods, and multiple package/action/source version bumps.

Changes

Cohort / File(s) Summary
GraphQL Queries
components/shopify/common/queries.mjs
Added query constants and exports: LIST_ORDERS, GET_DRAFT_ORDER, LIST_DRAFT_ORDERS, GET_CUSTOMER, LIST_CUSTOMERS, LIST_ASSIGNED_FULFILLMENT_ORDERS, GET_FULFILLMENT_ORDER, LIST_FULFILLMENT_ORDERS.
GraphQL Mutations
components/shopify/common/mutations.mjs
Added and exported UPDATE_ORDER mutation.
Shopify app API & propDefinitions
components/shopify/shopify.app.mjs
Added metafield propDefinitions: orderId, draftOrderId, customerId, fulfillmentOrderId; added methods: listOrders, getDraftOrder, listDraftOrders, updateOrder, getCustomer, listCustomers, listAssignedFulfillmentOrders, getFulfillmentOrder, listFulfillmentOrders.
Single-record actions
components/shopify/actions/get-customer/get-customer.mjs, components/shopify/actions/get-draft-order/get-draft-order.mjs, components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs
New actions to fetch a customer, draft order, and fulfillment order by ID (props, run implementations, summary exports).
Paginated/list actions
components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs, components/shopify/actions/get-customers/get-customers.mjs, components/shopify/actions/get-draft-orders/get-draft-orders.mjs, components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs, components/shopify/actions/search-orders/search-orders.mjs
New list actions using shopify.getPaginated with filtering/sorting props (query, sortKey, reverse, maxResults, includeClosed) and exporting result summaries.
Update Order action
components/shopify/actions/update-order/update-order.mjs
New action to update orders: builds input (id, optional email/note/tags/metafields), calls updateOrder, checks userErrors, exports summary, returns API response.
Version bumps & package
many components/shopify/actions/*, components/shopify/sources/*, components/shopify/package.json
Numerous action/source modules had patch version increments; package version bumped from 0.7.20.8.0.
Minor version-only changes
several action/source files (many components/shopify/actions/*, components/shopify/sources/*)
Patch version updates only (no logic changes) across many action and source modules.

Sequence Diagram(s)

sequenceDiagram
  participant UserAction as Action (user-triggered)
  participant ActionCode as Action module
  participant AppWrapper as shopify.app
  participant GraphQL as Shopify Admin GraphQL API
  participant Pager as Pagination helper

  UserAction->>ActionCode: invoke run()
  ActionCode->>AppWrapper: call method (e.g., listFulfillmentOrders / updateOrder / getCustomer) or this.shopify.getPaginated(...)
  AppWrapper->>GraphQL: _makeGraphQlRequest(queryOrMutation, variables)
  GraphQL-->>AppWrapper: return page/result (data, userErrors)
  alt paginated list
    AppWrapper->>Pager: fetch/accumulate pages via listX queries
    Pager-->>AppWrapper: aggregated items
  end
  AppWrapper-->>ActionCode: return data or mutation response
  ActionCode-->>ActionCode: $.export("$summary", summary)
  ActionCode-->>UserAction: return payload
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Focus review on GraphQL query/mutation field selections and whether requested fields match usages in actions.
  • Verify new app methods correctly call _makeGraphQlRequest with appropriate query constants and variable mappings.
  • Inspect update-order input building, metafields parsing, and userErrors handling for correct error propagation.
  • Spot-check pagination usage in getPaginated calls and summary exports for accurate counts.
  • Review propDefinition async option implementations (large option lists) for performance or pagination considerations.

Possibly related PRs

Suggested labels

User submitted

Suggested reviewers

  • michelle0927
  • GTFalcao

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description only contains 'Resolves #19331' without explaining the WHY, motivations, or key changes made in the PR. Expand the description to explain why these changes are needed, what new actions were added, and how they support the Shopify functionality expansion.
Title check ❓ Inconclusive The title '[ACTION] Shopify - new components' is vague and generic. It does not specify which components or what functionality was added. Use a more descriptive title like '[ACTION] Shopify - Add customer, order, draft order, and fulfillment order actions' to clearly indicate the main changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed All primary coding objectives from #19331 are fully met: order listing, draft order operations, customer retrieval, fulfillment order queries, and update order mutation are implemented as new actions.
Out of Scope Changes check ✅ Passed All changes are properly scoped to the objectives: new action modules, GraphQL queries/mutations, Shopify app methods, and version bumps for consistency. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch shopify-new-components

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 4

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e061bd2 and 1921067.

📒 Files selected for processing (12)
  • components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1 hunks)
  • components/shopify/actions/get-customer/get-customer.mjs (1 hunks)
  • components/shopify/actions/get-customers/get-customers.mjs (1 hunks)
  • components/shopify/actions/get-draft-order/get-draft-order.mjs (1 hunks)
  • components/shopify/actions/get-draft-orders/get-draft-orders.mjs (1 hunks)
  • components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs (1 hunks)
  • components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1 hunks)
  • components/shopify/actions/search-orders/search-orders.mjs (1 hunks)
  • components/shopify/actions/update-order/update-order.mjs (1 hunks)
  • components/shopify/common/mutations.mjs (2 hunks)
  • components/shopify/common/queries.mjs (2 hunks)
  • components/shopify/shopify.app.mjs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs (1)
components/shopify/shopify.app.mjs (1)
  • MAX_LIMIT (132-134)
components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)
components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)
  • fulfillmentOrders (56-68)
components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)
components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)
  • fulfillmentOrders (43-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (10)
components/shopify/common/mutations.mjs (1)

418-434: LGTM!

The UPDATE_ORDER mutation follows the established pattern in this file, includes proper error handling with userErrors, and returns appropriate fields for order updates.

Also applies to: 460-460

components/shopify/actions/get-customer/get-customer.mjs (1)

1-36: LGTM!

This action follows the established pattern for Shopify actions in this codebase. The implementation correctly uses propDefinition for the customer ID, includes helpful documentation links, and provides appropriate fallback in the summary export.

components/shopify/actions/search-orders/search-orders.mjs (1)

1-51: LGTM!

The search orders action correctly implements pagination using getPaginated, properly handles optional query filtering, and includes appropriate documentation. The plural handling in the summary export is a nice touch.

components/shopify/actions/get-draft-orders/get-draft-orders.mjs (1)

1-66: LGTM!

This action provides excellent documentation for the query syntax and sort options. The implementation follows the established pagination pattern and correctly uses propDefinitions for reusable properties.

components/shopify/actions/get-draft-order/get-draft-order.mjs (1)

1-36: LGTM!

The action follows the established pattern for single-item retrieval, uses appropriate propDefinition, and includes a sensible fallback in the summary export.

components/shopify/actions/get-customers/get-customers.mjs (1)

1-67: LGTM!

This action follows the established pagination pattern, includes helpful documentation with examples, and provides clear guidance about access scope requirements. The inline comment on line 16 is a useful reminder for developers.

components/shopify/actions/update-order/update-order.mjs (1)

69-71: No action required. The parseJson utility already includes built-in error handling via try-catch (returning the original input if JSON parsing fails), so the call at line 70 will not throw. Invalid JSON will be passed as-is to the downstream API, which provides error feedback via the userErrors field (line 77).

components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)

14-58: Get Assigned Fulfillment Orders action wiring looks correct

Props, pagination via getPaginated, and the resourceKeys: ["assignedFulfillmentOrders"] path all match the expected connection shape; summary export and return value are consistent with other Shopify actions in this app. No blocking issues from this file.

components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)

14-73: Get Fulfillment Orders action is correctly integrated with pagination

The props, filter arguments (query, includeClosed, sortKey, reverse), and use of this.shopify.getPaginated with resourceKeys: ["fulfillmentOrders"] are consistent with the existing pagination helper and the fulfillment orders query shape. No issues spotted here.

components/shopify/shopify.app.mjs (1)

247-306: New IDs and API methods are correctly wired into the Shopify app surface

The added orderId, draftOrderId, customerId, and fulfillmentOrderId propDefinitions correctly reuse getPropOptions with the right resourceFn, resourceKeys, and labelKey values, matching the shapes of the new list queries. Likewise, the new methods (listOrders, getDraftOrder, listDraftOrders, updateOrder, getCustomer, listCustomers, listAssignedFulfillmentOrders, getFulfillmentOrder, listFulfillmentOrders) are straightforward wrappers around _makeGraphQlRequest and keep the app API consistent with existing list/get helpers.

No additional changes needed here aside from fixing the underlying query field issues noted in queries.mjs.

Also applies to: 520-546

@jcortes jcortes force-pushed the shopify-new-components branch from 1921067 to 956f4af Compare December 8, 2025 23:37
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
components/shopify/actions/update-product-variant/update-product-variant.mjs (2)

139-139: Fix misleading success message text.

The summary message states "Created new product variant" but this action performs an update, not a create. This inconsistency may confuse users or downstream workflows.

Apply this diff to correct the message:

-    $.export("$summary", `Created new product variant \`${response.productVariantsBulkUpdate.productVariants[0].title}\` with ID \`${response.productVariantsBulkUpdate.productVariants[0].id}\``);
+    $.export("$summary", `Updated product variant \`${response.productVariantsBulkUpdate.productVariants[0].title}\` with ID \`${response.productVariantsBulkUpdate.productVariants[0].id}\``);

136-138: Consider reporting all errors, not just the first.

Currently, only the first userError is surfaced if the GraphQL mutation returns multiple errors. For better observability and debugging, consider aggregating and reporting all errors.

Apply this diff to report all errors:

     if (response.productVariantsBulkUpdate.userErrors.length > 0) {
-      throw new Error(response.productVariantsBulkUpdate.userErrors[0].message);
+      const errorMessages = response.productVariantsBulkUpdate.userErrors
+        .map((error) => error.message)
+        .join("; ");
+      throw new Error(errorMessages);
     }
components/shopify/actions/search-products/search-products.mjs (2)

116-123: Client-side filtering applied after pagination causes result count mismatch.

When exactMatch is false, products are filtered client-side after pagination (line 117–119). This means:

  • If a user sets maxResults: 10 and performs a non-exact title search, the API returns 10 products, but after client-side filtering, only 5 might match the title.
  • The final result count becomes unpredictable and often less than the requested maxResults.

Consider performing the non-exact match filter before pagination, or fetch additional products to compensate for post-filter reduction.


83-98: Escape special characters in search query string construction to prevent GraphQL injection.

User input (title, productType, vendor) is interpolated directly into the search query string without escaping. Per Shopify's documentation, GraphQL variables cannot be used within search query string literals, so the query must be constructed server-side with proper escaping. At minimum, escape double quotes in all user-supplied fields:

if (this.title && this.exactMatch) {
-  queryArray.push(`title:"${this.title}"`);
+  const escapedTitle = this.title.replace(/"/g, '\\"');
+  queryArray.push(`title:"${escapedTitle}"`);
}
if (this.productType) {
-  queryArray.push(`product_type:${this.productType}`);
+  const escapedType = this.productType.replace(/"/g, '\\"');
+  queryArray.push(`product_type:${escapedType}`);
}
if (this.vendor) {
-  queryArray.push(`vendor:${this.vendor}`);
+  const escapedVendor = this.vendor.replace(/"/g, '\\"');
+  queryArray.push(`vendor:${escapedVendor}`);
}

Consider expanding validation to reject or escape other special characters (colons, parentheses) that could alter query syntax.

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

151-151: Fix array indexing: productVariants is an array, not a single object.

Line 151 accesses response.productVariantsBulkCreate.productVariants.title and .id as if it's a single object, but the Shopify GraphQL mutation returns productVariants as an array. This will return undefined and cause the summary export to fail.

The create-product-variant action in the same codebase correctly uses [0] indexing to access the first variant:

-      $.export("$summary", `Created new product variant \`${response.productVariantsBulkCreate.productVariants.title}\` with ID \`${response.productVariantsBulkCreate.productVariants.id}\``);
+      $.export("$summary", `Created new product variant \`${response.productVariantsBulkCreate.productVariants[0].title}\` with ID \`${response.productVariantsBulkCreate.productVariants[0].id}\``);
♻️ Duplicate comments (6)
components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs (1)

30-34: Remove the first: MAX_LIMIT parameter from the single-item fetch.

This action retrieves a single fulfillment order by ID. The first pagination parameter is only applicable to list operations and is inconsistent with other single-item fetch actions (getCustomer, getOrder, getDraftOrder) in this codebase.

   async run({ $ }) {
     const { fulfillmentOrder } = await this.shopify.getFulfillmentOrder({
       id: this.fulfillmentOrderId,
-      first: MAX_LIMIT,
     });
components/shopify/actions/update-order/update-order.mjs (1)

77-79: Consider surfacing all user errors, not just the first one.

Currently, only the first userError is thrown. If multiple validation errors exist, the user will need to fix them one at a time.

components/shopify/common/queries.mjs (4)

626-633: Fix invalid GraphQL field in GET_DRAFT_ORDER.

Line 632 selects note which is not a valid field on the DraftOrder type. The DraftOrder object exposes note2 (line 633) for the response. The note field only exists on DraftOrderInput for mutations.


903-949: Fix invalid GraphQL field in GET_CUSTOMER.

Line 946 uses ordersCount which does not exist on the Customer type. The correct field name is numberOfOrders.


647-680: Replace deprecated countryCode with countryCodeV2.

The countryCode field is deprecated in Shopify's Admin GraphQL API. Use countryCodeV2 (which returns a CountryCode enum) for address and destination fields to ensure compatibility with current and future API versions.

Also applies to: 783-816, 918-945, 967-994


1034-1034: Avoid reusing $first for nested lineItems connections.

Reusing the top-level $first parameter for nested lineItems connections increases query complexity and can cause throttling. Per Shopify best practices, either hardcode smaller values (e.g., lineItems(first: 50)) as done in LIST_ORDERS line 556, or expose separate variables.

Also applies to: 1086-1086, 1133-1133

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1921067 and 956f4af.

📒 Files selected for processing (50)
  • components/shopify/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs (1 hunks)
  • components/shopify/actions/add-tags/add-tags.mjs (1 hunks)
  • components/shopify/actions/bulk-import/bulk-import.mjs (1 hunks)
  • components/shopify/actions/create-article/create-article.mjs (1 hunks)
  • components/shopify/actions/create-blog/create-blog.mjs (1 hunks)
  • components/shopify/actions/create-custom-collection/create-custom-collection.mjs (1 hunks)
  • components/shopify/actions/create-metafield/create-metafield.mjs (1 hunks)
  • components/shopify/actions/create-metaobject/create-metaobject.mjs (1 hunks)
  • components/shopify/actions/create-page/create-page.mjs (1 hunks)
  • components/shopify/actions/create-product-variant/create-product-variant.mjs (1 hunks)
  • components/shopify/actions/create-product/create-product.mjs (1 hunks)
  • components/shopify/actions/create-smart-collection/create-smart-collection.mjs (1 hunks)
  • components/shopify/actions/delete-article/delete-article.mjs (1 hunks)
  • components/shopify/actions/delete-blog/delete-blog.mjs (1 hunks)
  • components/shopify/actions/delete-metafield/delete-metafield.mjs (1 hunks)
  • components/shopify/actions/delete-page/delete-page.mjs (1 hunks)
  • components/shopify/actions/get-articles/get-articles.mjs (1 hunks)
  • components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1 hunks)
  • components/shopify/actions/get-customer/get-customer.mjs (1 hunks)
  • components/shopify/actions/get-customers/get-customers.mjs (1 hunks)
  • components/shopify/actions/get-draft-order/get-draft-order.mjs (1 hunks)
  • components/shopify/actions/get-draft-orders/get-draft-orders.mjs (1 hunks)
  • components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs (1 hunks)
  • components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1 hunks)
  • components/shopify/actions/get-metafields/get-metafields.mjs (1 hunks)
  • components/shopify/actions/get-metaobjects/get-metaobjects.mjs (1 hunks)
  • components/shopify/actions/get-pages/get-pages.mjs (1 hunks)
  • components/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs (1 hunks)
  • components/shopify/actions/search-orders/search-orders.mjs (1 hunks)
  • components/shopify/actions/search-product-variant/search-product-variant.mjs (1 hunks)
  • components/shopify/actions/search-products/search-products.mjs (1 hunks)
  • components/shopify/actions/update-article/update-article.mjs (1 hunks)
  • components/shopify/actions/update-inventory-level/update-inventory-level.mjs (1 hunks)
  • components/shopify/actions/update-metafield/update-metafield.mjs (1 hunks)
  • components/shopify/actions/update-metaobject/update-metaobject.mjs (1 hunks)
  • components/shopify/actions/update-order/update-order.mjs (1 hunks)
  • components/shopify/actions/update-page/update-page.mjs (1 hunks)
  • components/shopify/actions/update-product-variant/update-product-variant.mjs (1 hunks)
  • components/shopify/actions/update-product/update-product.mjs (1 hunks)
  • components/shopify/common/mutations.mjs (2 hunks)
  • components/shopify/common/queries.mjs (2 hunks)
  • components/shopify/package.json (1 hunks)
  • components/shopify/shopify.app.mjs (2 hunks)
  • components/shopify/sources/collection-updated/collection-updated.mjs (1 hunks)
  • components/shopify/sources/customer-data-request/customer-data-request.mjs (1 hunks)
  • components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs (1 hunks)
  • components/shopify/sources/new-article/new-article.mjs (1 hunks)
  • components/shopify/sources/new-event-emitted/new-event-emitted.mjs (1 hunks)
  • components/shopify/sources/new-page/new-page.mjs (1 hunks)
  • components/shopify/sources/new-product-created/new-product-created.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/shopify/actions/get-customers/get-customers.mjs
🧬 Code graph analysis (2)
components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)
components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)
  • fulfillmentOrders (43-53)
components/shopify/actions/update-order/update-order.mjs (14)
components/shopify/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs (1)
  • response (33-36)
components/shopify/actions/add-tags/add-tags.mjs (1)
  • response (67-70)
components/shopify/actions/bulk-import/bulk-import.mjs (1)
  • response (136-140)
components/shopify/actions/create-article/create-article.mjs (1)
  • response (59-73)
components/shopify/actions/create-blog/create-blog.mjs (1)
  • response (23-27)
components/shopify/actions/create-custom-collection/create-custom-collection.mjs (1)
  • response (44-53)
components/shopify/actions/create-metafield/create-metafield.mjs (1)
  • response (56-65)
components/shopify/actions/create-page/create-page.mjs (1)
  • response (28-33)
components/shopify/actions/create-product-variant/create-product-variant.mjs (1)
  • response (121-147)
components/shopify/actions/create-product/create-product.mjs (1)
  • response (72-86)
components/shopify/actions/create-smart-collection/create-smart-collection.mjs (1)
  • response (73-81)
components/shopify/actions/delete-blog/delete-blog.mjs (1)
  • response (24-26)
components/shopify/actions/delete-metafield/delete-metafield.mjs (1)
  • response (48-54)
components/shopify/actions/delete-page/delete-page.mjs (1)
  • response (24-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (58)
components/shopify/actions/create-blog/create-blog.mjs (1)

7-7: Version bump approved.

The change is a straightforward version increment (0.0.8 → 0.0.9) with no functional modifications. This aligns with the broader PR's pattern of updating module versions to reflect the expanded Shopify action suite.

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

7-7: Version bump is appropriate.

The version bump from 0.0.8 to 0.0.9 is consistent with the PR's objective of expanding Shopify functionality. The rest of the action implementation remains unchanged and correct—error handling is in place, the async run method is properly structured, and the export summary provides useful feedback.

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

10-10: Version bump is appropriate.

The version bump from 0.0.14 to 0.0.15 aligns with the broader PR scope of expanding Shopify action functionality. The existing code quality is solid—proper error handling, well-structured API calls, and clear user feedback via summary export.

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

7-7: Version bump with no functional changes.

The version has been incremented from 0.0.8 to 0.0.9, but the rest of the file remains unchanged. If this version bump is part of a coordinated PR-wide versioning strategy (e.g., bumping all Shopify actions in lock-step), please confirm that's the intent. Otherwise, consider whether a version bump is necessary when there are no code changes to this file.

components/shopify/actions/create-metafield/create-metafield.mjs (2)

8-8: Verify the rationale for this version bump.

Line 8 shows a version bump to 0.0.13, but the AI summary indicates no changes to exported/public entity signatures or runtime behavior in this file. According to semver conventions, version bumps typically correspond to new features (minor), bug fixes (patch), or breaking changes (major).

Is this version bump intentional as part of a coordinated release across multiple Shopify actions, or should it be reverted?


1-72: Implementation is correct.

The create-metafield action implementation remains sound:

  • Props are well-defined with appropriate types, labels, and descriptions
  • Error handling properly checks and throws on GraphQL user errors (line 66–68)
  • Summary export is clear and informative (line 69)
  • GraphQL call respects the Shopify API contract
components/shopify/actions/delete-article/delete-article.mjs (1)

7-7: Verify the version bump is justified.

The version was incremented from 0.0.8 to 0.0.9. Since the action's logic, error handling, and exported signatures remain unchanged, this bump appears to be driven by changes elsewhere in the Shopify app definition or shared API. Please confirm:

  1. Were the Shopify app's propDefinitions (specifically blogId or articleId) or shared methods modified in a way that affects this action?
  2. Is this version bump part of a coordinated versioning strategy for all existing Shopify actions, or only those with affected dependencies?
components/shopify/actions/delete-metafield/delete-metafield.mjs (1)

8-8: Clarify the rationale for the version bump.

The version has been incremented from "0.0.10" to "0.0.11", but per the AI summary, there are no changes to runtime logic, props, error handling, or public API shape in this file. Additionally, this file is an existing action—not one of the new actions listed in the PR objectives (get-orders, get-draft-orders, get-customers, etc.).

Verify whether this version bump is:

  • A consequence of changes to the shared common module (line 1) or the Shopify client API?
  • Aligned with the PR's primary objectives?
  • Following a standardized versioning strategy across all actions in this PR?
components/shopify/actions/create-product/create-product.mjs (2)

8-8: Verify version bump is justified.

The version was bumped from 0.0.14 to 0.0.15, but no functional or control-flow changes were detected in this file. Patch version bumps typically indicate bug fixes or internal improvements, not additions to unrelated components.

Clarify whether this version bump is part of a coordinated module-level release strategy, or if it should be reverted.


1-92: Code structure and implementation appear correct.

The action properly imports dependencies, defines props with appropriate validation (optional flags, enumerated options), and implements error handling for GraphQL responses. The implementation correctly transforms input to the GraphQL mutation format and provides user-friendly export summaries.

components/shopify/actions/update-product-variant/update-product-variant.mjs (1)

12-12: Verify version bump justification.

The version is incremented without any corresponding code changes in this file. If this is part of a broader release across multiple Shopify actions (as indicated by the PR context), please confirm this is intentional. However, if only unrelated files are being changed in this PR, consider whether bumping this action's version is appropriate per semver conventions.

components/shopify/actions/update-article/update-article.mjs (3)

7-7: Verify version bump rationale.

The version is being bumped from 0.0.8 to 0.0.9 with no functional changes to this action. Per the PR context, this is part of a broader set of version bumps across the Shopify actions. Confirm that this is intentional (e.g., for consistency across the Shopify app surface or due to a dependency change).


1-92: Code structure and error handling look good.

The action module is well-structured with proper:

  • Imports and dependencies
  • Metadata and annotations (correctly marked as destructive)
  • Props definition with dynamic dependencies (articleId depends on blogId context)
  • Error handling for GraphQL mutations (checks userErrors array)
  • Response export with meaningful summary

69-92: The updateArticle method exists and is properly implemented on the shopify app object.

The method at components/shopify/shopify.app.mjs accepts a variables object and delegates to this._makeGraphQlRequest(mutations.UPDATE_ARTICLE, variables). The usage in the run method—passing an object with id and article properties—matches the expected signature. The return value is assumed to follow the structure expected by the code (response.articleUpdate.userErrors and response.articleUpdate.article.id), which should be validated against the UPDATE_ARTICLE GraphQL mutation response schema.

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

9-9: Version bump approved.

The metadata version update is routine and well-placed as part of the broader Shopify component updates.

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

8-8: Remove this comment — the version assignment is appropriate for a new action.

This file is newly added (not a modification of existing code), so the version "0.0.14" is a proper initial version for this new Shopify action, not an unnecessary bump. The implementation includes functional filtering logic for namespace and key parameters, making it a complete feature addition.

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

10-10: Version bump aligns with package release.

The version increment from 0.0.19 to 0.0.20 is appropriate and consistent with the package-wide version bump to 0.8.0.

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

7-7: Version bump aligns with package release.

The version increment is appropriate and consistent with the coordinated release.

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

8-8: Version bump aligns with package release.

The version increment is appropriate and consistent with the package-wide update to 0.8.0.

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

7-7: Version bump aligns with package release.

The version increment is appropriate and consistent with the coordinated release cycle.

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

7-7: Version bump aligns with package release.

The version increment is appropriate and consistent with the package update to 0.8.0.

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

8-8: Version bump aligns with package release.

The version increment is appropriate and consistent with the coordinated release.

components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs (1)

9-9: Version bump aligns with package release.

The version increment from 0.0.20 to 0.0.21 is appropriate and consistent with the package-wide version bump to 0.8.0.

components/shopify/package.json (1)

3-3: Appropriate minor version bump for new features.

The version increment from 0.7.2 to 0.8.0 correctly follows semantic versioning for a release that adds new Shopify actions (orders, draft orders, customers, fulfillment orders) as described in the PR objectives.

components/shopify/sources/new-product-created/new-product-created.mjs (1)

10-10: LGTM!

Version bump aligns with the broader release adding new Shopify components.

components/shopify/sources/collection-updated/collection-updated.mjs (1)

9-9: LGTM!

Version bump is appropriate for this release.

components/shopify/actions/bulk-import/bulk-import.mjs (1)

10-10: LGTM!

Version increment is consistent with the PR's release cadence.

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

7-7: LGTM!

Version bump is appropriate for this coordinated release.

components/shopify/sources/customer-data-request/customer-data-request.mjs (1)

5-5: LGTM!

Version increment aligns with the release.

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

10-10: LGTM!

Version bump is consistent with the PR's versioning strategy.

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

10-10: LGTM!

Version increment is appropriate for this release.

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

12-12: LGTM!

Version bump aligns with the broader release.

components/shopify/actions/update-product/update-product.mjs (1)

9-9: Version bump is appropriate for non-breaking feature additions.

Minor version increment aligns with the PR's broader Shopify expansion without altering runtime behavior.

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

8-8: Version bump aligns with non-breaking feature expansions.

Patch-level increment is appropriate given no runtime changes to this action.

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

7-7: Version increment is consistent with PR-wide updates.

Patch-level bump reflects the broader Shopify action surface expansion without modifying this action's behavior.

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

7-7: Version increment is appropriate.

Patch-level bump aligns with non-breaking feature additions in this PR iteration.

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

8-8: Version bump follows PR-wide pattern.

Patch-level increment is consistent with non-breaking feature expansion across Shopify actions.

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

10-10: Version increment aligns with non-breaking updates.

Patch-level bump is consistent with the PR's broader feature expansion.

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

10-10: Version bump is consistent with non-breaking feature additions.

Patch-level increment aligns with the broader PR updates to Shopify action surface.

components/shopify/sources/new-event-emitted/new-event-emitted.mjs (2)

10-10: Version increment aligns with PR-wide updates.

Patch-level bump is consistent with the broader Shopify component expansion.


1-41: Incomplete review scope: Missing new action files referenced in PR objectives.

The PR objectives specify multiple new Shopify actions (get-customer, get-customers, get-draft-order, get-draft-orders, get-fulfillment-orders, search-orders, update-order, etc.) with their corresponding GraphQL mutations and propDefinitions, but these files were not provided for review. The current review covers only version bumps on existing actions.

To complete the review, please provide:

  1. New action files (get-customer.mjs, get-customers.mjs, get-draft-order.mjs, etc.)
  2. Updated components/shopify/common/queries.mjs with new GraphQL query definitions
  3. Updated components/shopify/common/mutations.mjs with new GraphQL mutation definitions
  4. Updated components/shopify/shopify.app.mjs with new propDefinitions and wrapper methods
  5. Test coverage for the new actions

Can you confirm whether these files exist in the PR and should be included in the review?

components/shopify/actions/get-draft-order/get-draft-order.mjs (1)

29-35: LGTM!

The run function correctly retrieves a draft order by ID, handles the response destructuring, and provides a meaningful summary with fallback to ID if name is unavailable.

components/shopify/actions/get-customer/get-customer.mjs (1)

1-36: LGTM!

The action is well-structured with appropriate metadata, correct info alert content for customer data access, and proper handling of the response with a meaningful summary fallback.

components/shopify/common/mutations.mjs (2)

418-434: LGTM!

The UPDATE_ORDER mutation follows the established pattern with proper input typing, relevant return fields, and consistent userErrors handling.


460-460: LGTM!

The new mutation is correctly added to the default export.

components/shopify/actions/search-orders/search-orders.mjs (2)

35-50: LGTM!

The pagination logic is correctly implemented with getPaginated, the query variable is properly passed, and the summary handles singular/plural forms correctly.


22-33: LGTM!

The query and max props are appropriately defined as optional with clear descriptions and correct types.

components/shopify/actions/get-draft-orders/get-draft-orders.mjs (1)

1-66: LGTM!

The action follows the established pattern for paginated Shopify list actions. The query filtering, sorting, and pagination are correctly implemented.

components/shopify/actions/get-customers/get-customers.mjs (1)

1-67: LGTM!

The action correctly implements customer retrieval with proper query filtering, sorting, and pagination. The summary message format aligns with established patterns.

components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)

1-59: LGTM!

The action correctly retrieves assigned fulfillment orders with appropriate sorting and pagination.

components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)

1-74: LGTM!

The action properly implements fulfillment order retrieval with comprehensive filtering options including query syntax and the includeClosed flag.

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

1153-1179: LGTM on the export additions.

The new query constants are correctly added to the default export, extending the public API surface.

components/shopify/shopify.app.mjs (2)

247-306: LGTM on the new propDefinitions.

The four new propDefinitions (orderId, draftOrderId, customerId, fulfillmentOrderId) follow the established pattern and use appropriate label keys for user-friendly option display.


520-546: LGTM on the new methods.

All nine new methods correctly delegate to _makeGraphQlRequest with the appropriate query or mutation constants. The implementation is consistent with existing patterns in the codebase.

components/shopify/actions/update-order/update-order.mjs (1)

55-83: Input structure is correct and aligns with Shopify's orderUpdate API.

The code correctly assembles the orderUpdate mutation input with all valid fields. According to Shopify's GraphQL Admin API, OrderInput supports id, email, note, tags, and metafields (as an array of MetafieldInput objects). The optional field handling is proper, and the metafields parsing via utils.parseJson() is appropriate.

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

10-10: Version bump aligned with PR scope.

The version bump from 0.0.14 to 0.0.15 is consistent with the coordinated updates across multiple Shopify actions in this PR. No functional concerns with the version change itself.

components/shopify/actions/delete-blog/delete-blog.mjs (2)

1-30: Inconsistency: Provided files don't match PR objectives.

The PR objectives indicate this should add multiple NEW Shopify actions for orders, draft orders, customers, and fulfillment orders (e.g., get-assigned-fulfillment-orders, get-customer, get-customers, etc.). However, only this existing delete-blog action with a version bump is provided for review.

Unable to perform a comprehensive review aligned with the stated PR objectives without access to the new action files and the updated shopify.app.mjs.


7-7: The delete-blog action is a newly created component, not a modification with a version bump.

This file is part of the "[ACTION] Shopify - new components" commit and is being added as a new action (new file mode 100644), not incremented from a prior version. The version 0.0.9 is the initial version assigned to this new action component, not a bump from 0.0.8. The version selection appears intentional and is consistent with other newly added Shopify actions in the same commit.

Likely an incorrect or invalid review comment.

GTFalcao
GTFalcao previously approved these changes Dec 9, 2025
Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

@jcortes jcortes force-pushed the shopify-new-components branch 2 times, most recently from c81f7bb to 0d67e74 Compare December 11, 2025 15:30
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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/shopify/actions/delete-metafield/delete-metafield.mjs (1)

45-53: Guard against missing metafield before accessing its properties.

If this.metafieldId doesn’t match any item returned by listMetafields, metafield will be undefined, and accessing metafield.key / metafield.namespace will throw a runtime error.

Add an explicit check and surface a clear error:

   async run({ $ }) {
     const metafields = await this.listMetafields(this.ownerResource, this.ownerId);
-    const metafield = metafields.find(({ id }) => id === this.metafieldId);
+    const metafield = metafields.find(({ id }) => id === this.metafieldId);
+
+    if (!metafield) {
+      throw new Error(`Metafield with ID ${this.metafieldId} not found for owner ${this.ownerId}`);
+    }
 
     const response = await this.shopify.deleteMetafield({
       metafields: {
         key: metafield.key,
         ownerId: this.ownerId,
         namespace: metafield.namespace,
       },
     });
♻️ Duplicate comments (6)
components/shopify/actions/update-order/update-order.mjs (1)

77-79: Aggregate and surface all userErrors instead of just the first one.

Right now only response.orderUpdate.userErrors[0].message is thrown. When there are multiple validation issues, users will have to fix them one-by-one without seeing the full set of problems.

You can aggregate messages (optionally including fields) to provide better feedback:

-    if (response.orderUpdate.userErrors.length > 0) {
-      throw new Error(response.orderUpdate.userErrors[0].message);
-    }
+    if (response.orderUpdate.userErrors.length > 0) {
+      const errorMessages = response.orderUpdate.userErrors
+        .map((err) => `${err.field ? `${err.field}: ` : ""}${err.message}`)
+        .join("; ");
+      throw new Error(errorMessages);
+    }
components/shopify/common/queries.mjs (2)

782-798: Replace deprecated countryCode with countryCodeV2 in LIST_DRAFT_ORDERS addresses

Lines 788 and 805 use the deprecated countryCode field in billingAddress and shippingAddress. The related GET_DRAFT_ORDER query (lines 652, 669) correctly uses countryCodeV2. Per Shopify's Admin GraphQL API, countryCode is deprecated in favor of countryCodeV2 (CountryCode enum).

Apply this diff:

       billingAddress {
         address1
         address2
         city
         company
         country
-        countryCode
+        countryCodeV2
         firstName
         lastName
         phone
@@
       shippingAddress {
         address1
         address2
         city
         company
         country
-        countryCode
+        countryCodeV2
         firstName
         lastName
         phone

Also applies to: 799-815


1030-1041: Avoid reusing $first for nested lineItems connections in fulfillment order queries

Lines 1030, 1082, and 1129 reuse the top-level $first variable for nested lineItems connections. This multiplies query complexity and can trigger Shopify's throttling limits on large datasets. Other queries in this file correctly hard‑code smaller limits: LIST_ORDERS uses lineItems(first: 50) at line 556, and both GET_DRAFT_ORDER and LIST_DRAFT_ORDERS use lineItems(first: 250) at lines 689 and 825.

Apply this diff to hard‑code reasonable limits:

 const LIST_ASSIGNED_FULFILLMENT_ORDERS = `
-  query ($first: Int, $after: String, $reverse: Boolean, $sortKey: FulfillmentOrderSortKeys) {
+  query ($first: Int, $after: String, $reverse: Boolean, $sortKey: FulfillmentOrderSortKeys, $lineItemsFirst: Int) {
     assignedFulfillmentOrders(first: $first, after: $after, reverse: $reverse, sortKey: $sortKey) {
@@
-        lineItems(first: $first) {
+        lineItems(first: 50) {
           nodes {
@@
 const GET_FULFILLMENT_ORDER = `
-  query ($id: ID!, $first: Int) {
+  query ($id: ID!) {
     fulfillmentOrder(id: $id) {
@@
-      lineItems(first: $first) {
+      lineItems(first: 50) {
         nodes {
@@
 const LIST_FULFILLMENT_ORDERS = `
-  query ($first: Int, $after: String, $reverse: Boolean, $sortKey: FulfillmentOrderSortKeys, $query: String) {
+  query ($first: Int, $after: String, $reverse: Boolean, $sortKey: FulfillmentOrderSortKeys, $query: String, $lineItemsFirst: Int) {
     fulfillmentOrders(first: $first, after: $after, reverse: $reverse, sortKey: $sortKey, query: $query) {
@@
-        lineItems(first: $first) {
+        lineItems(first: 50) {
           nodes {

Also applies to: 1082-1093, 1129-1140

components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs (2)

2-2: Remove unused MAX_LIMIT import

After removing the pagination parameter from the getFulfillmentOrder call (see next comment), this import becomes unused.

 import shopify from "../../shopify.app.mjs";
-import { MAX_LIMIT } from "../../common/constants.mjs";

30-34: Remove pagination parameter from single-item fetch

This action retrieves a single fulfillment order by ID. Unlike list operations, single-item fetch actions (getCustomer, getDraftOrder) do not use pagination parameters. The first: MAX_LIMIT parameter is inconsistent with these patterns and unnecessary for a single-item query.

     const { fulfillmentOrder } = await this.shopify.getFulfillmentOrder({
       id: this.fulfillmentOrderId,
-      first: MAX_LIMIT,
     });
components/shopify/actions/get-draft-order/get-draft-order.mjs (1)

17-21: Correct info alert to reference draft orders instead of customer data

The alert mentions "customer data" and links to protected customer data documentation, but this action retrieves draft orders. Update the content to reference draft order access scopes.

     info: {
       type: "alert",
       alertType: "info",
-      content: "Please verify that the Shopify shop has customer data properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)",
+      content: "Please verify that the Shopify shop has draft orders properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/admin-api/access-scopes)",
     },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 956f4af and 0d67e74.

📒 Files selected for processing (50)
  • components/shopify/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs (1 hunks)
  • components/shopify/actions/add-tags/add-tags.mjs (1 hunks)
  • components/shopify/actions/bulk-import/bulk-import.mjs (1 hunks)
  • components/shopify/actions/create-article/create-article.mjs (1 hunks)
  • components/shopify/actions/create-blog/create-blog.mjs (1 hunks)
  • components/shopify/actions/create-custom-collection/create-custom-collection.mjs (1 hunks)
  • components/shopify/actions/create-metafield/create-metafield.mjs (1 hunks)
  • components/shopify/actions/create-metaobject/create-metaobject.mjs (1 hunks)
  • components/shopify/actions/create-page/create-page.mjs (1 hunks)
  • components/shopify/actions/create-product-variant/create-product-variant.mjs (1 hunks)
  • components/shopify/actions/create-product/create-product.mjs (1 hunks)
  • components/shopify/actions/create-smart-collection/create-smart-collection.mjs (1 hunks)
  • components/shopify/actions/delete-article/delete-article.mjs (1 hunks)
  • components/shopify/actions/delete-blog/delete-blog.mjs (1 hunks)
  • components/shopify/actions/delete-metafield/delete-metafield.mjs (1 hunks)
  • components/shopify/actions/delete-page/delete-page.mjs (1 hunks)
  • components/shopify/actions/get-articles/get-articles.mjs (1 hunks)
  • components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1 hunks)
  • components/shopify/actions/get-customer/get-customer.mjs (1 hunks)
  • components/shopify/actions/get-customers/get-customers.mjs (1 hunks)
  • components/shopify/actions/get-draft-order/get-draft-order.mjs (1 hunks)
  • components/shopify/actions/get-draft-orders/get-draft-orders.mjs (1 hunks)
  • components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs (1 hunks)
  • components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1 hunks)
  • components/shopify/actions/get-metafields/get-metafields.mjs (1 hunks)
  • components/shopify/actions/get-metaobjects/get-metaobjects.mjs (1 hunks)
  • components/shopify/actions/get-pages/get-pages.mjs (1 hunks)
  • components/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs (1 hunks)
  • components/shopify/actions/search-orders/search-orders.mjs (1 hunks)
  • components/shopify/actions/search-product-variant/search-product-variant.mjs (1 hunks)
  • components/shopify/actions/search-products/search-products.mjs (1 hunks)
  • components/shopify/actions/update-article/update-article.mjs (1 hunks)
  • components/shopify/actions/update-inventory-level/update-inventory-level.mjs (1 hunks)
  • components/shopify/actions/update-metafield/update-metafield.mjs (1 hunks)
  • components/shopify/actions/update-metaobject/update-metaobject.mjs (1 hunks)
  • components/shopify/actions/update-order/update-order.mjs (1 hunks)
  • components/shopify/actions/update-page/update-page.mjs (1 hunks)
  • components/shopify/actions/update-product-variant/update-product-variant.mjs (1 hunks)
  • components/shopify/actions/update-product/update-product.mjs (1 hunks)
  • components/shopify/common/mutations.mjs (2 hunks)
  • components/shopify/common/queries.mjs (2 hunks)
  • components/shopify/package.json (1 hunks)
  • components/shopify/shopify.app.mjs (2 hunks)
  • components/shopify/sources/collection-updated/collection-updated.mjs (1 hunks)
  • components/shopify/sources/customer-data-request/customer-data-request.mjs (1 hunks)
  • components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs (1 hunks)
  • components/shopify/sources/new-article/new-article.mjs (1 hunks)
  • components/shopify/sources/new-event-emitted/new-event-emitted.mjs (1 hunks)
  • components/shopify/sources/new-page/new-page.mjs (1 hunks)
  • components/shopify/sources/new-product-created/new-product-created.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/shopify/actions/get-draft-order/get-draft-order.mjs
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/shopify/actions/get-customers/get-customers.mjs
🧬 Code graph analysis (2)
components/shopify/actions/update-order/update-order.mjs (1)
components/shopify/actions/create-custom-collection/create-custom-collection.mjs (1)
  • response (44-53)
components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)
components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)
  • fulfillmentOrders (56-68)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (51)
components/shopify/actions/delete-article/delete-article.mjs (1)

7-7: Version bump is appropriate.

The patch version increment from 0.0.8 to 0.0.9 is suitable for this update as part of the broader Shopify actions expansion. The file structure, annotations, and implementation remain sound with no functional changes.

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

7-7: Version bump approved.

The patch version increment (0.0.8 → 0.0.9) is appropriate for this maintenance release. The implementation remains sound with proper GraphQL error handling and summary export.

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

7-7: Version bump is appropriate.

This patch-level version increment aligns with the coordinated version updates across multiple Shopify actions in the PR, driven by underlying app changes and new functionality. No functional changes to review.

components/shopify/actions/create-metaobject/create-metaobject.mjs (2)

10-10: Version bump is standalone.

This is a straightforward version increment with no behavioral changes to the action. Ensure this aligns with your versioning strategy for the coordinated Shopify action updates mentioned in the PR.


45-77: Run method logic is sound.

The action correctly handles metaobject creation, validates the type, constructs fields from props, and includes error handling for GraphQL user errors. The success export is clear.

Given that the PR reviewers reported test failures across multiple Shopify actions, please verify that the createMetaobject method (called on line 63) and the upstream listMetaobjectDefinitions call (lines 32 and 46) still function correctly with any recent changes to the Shopify app configuration or GraphQL schema.

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

8-8: Version bump is appropriate and consistent with package release.

The version increment from 0.0.12 to 0.0.13 is consistent with the broader package version bump (0.7.2 → 0.8.0). The underlying action logic remains unchanged and correct.

However, note that the provided review context indicates reviewer vunguyenhung reported failing or needing-improvement test cases. Since only a single file has been provided for this review (and the PR introduces numerous new Shopify actions and mutations), please verify that this existing action is not impacted by any of the new components or changes to common mutations/queries that may be shared across actions. The linked test reports may provide guidance on which actions or flows are affected.

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

8-8: Verify the justification for this version bump.

The version is incremented from 0.0.7 to 0.0.8, but there are no behavioral changes to this action file itself. While the AI summary indicates this is part of a broader coordinated version update across multiple Shopify actions, confirm that this bump is justified—whether due to indirect dependency updates, schema changes, or as part of a consistent release strategy.

If other action files in this PR also have version bumps without code changes, document the coordinated release strategy. Alternatively, if this bump is only justified by indirect impacts (e.g., shopify.app.mjs changes), verify those impacts are material to this action's behavior or interface.

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

8-8: Verify the rationale for the version bump.

The version is being incremented from 0.0.8 to 0.0.9, but no functional changes are visible in this file. According to the PR summary, this appears to be part of a broader coordinated version bump across multiple Shopify actions.

Please clarify the motivation for this patch-level version increment. Is this bump coordinated across all actions due to an underlying app-level change (e.g., shopify.app.mjs or utilities update), or is it tied to a specific fix for this action that isn't visible in the diff?

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

10-10: Version bump is consistent with a non‑breaking metadata update

This file only changes the action version to "0.0.15" with no behavioral modifications, which is appropriate for tracking the new release in the broader Shopify updates.

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

7-7: Version bump is appropriate; action code looks good.

The patch version increment from 0.0.8 to 0.0.9 is consistent with the PR's systematic version updates. The action's structure, error handling, and destructive operation annotations are correctly configured.

Given that the PR has reported test failures, please verify that this delete-page action continues to function correctly in the broader context of the changes.

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

7-7: Version bump looks consistent with other Shopify actions

The patch version increment to "0.0.9" is appropriate and there are no behavioral changes in this module. Nothing else to address here.

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

10-10: LGTM: Version bump for consistency.

The patch version increment aligns with the broader Shopify integration updates in this PR. No functional changes introduced.

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

7-7: LGTM: Routine version bump.

The patch version increment is appropriate for this release cycle, which adds new Shopify components to the package while maintaining existing functionality.

components/shopify/actions/get-metaobjects/get-metaobjects.mjs (2)

27-39: Implementation is sound and follows Pipedream conventions.

The run() method properly integrates with the Shopify app's listMetaobjects method, uses appropriate limiting, and exports a well-formatted summary with correct pluralization.


10-10: Version bump is appropriate.

The patch version bump from 0.0.6 to 0.0.7 is reasonable. The shopify.listMetaobjects() method is properly implemented in shopify.app.mjs and correctly makes the GraphQL request using queries.LIST_METAOBJECTS. The MAX_LIMIT constant is properly imported, and the code structure is clean.

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

10-10: LGTM: Version bump is appropriate.

The version increment from 0.0.8 to 0.0.9 is consistent with the PR-wide version release cycle. No functional changes are present in this file.

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

1-33: Implementation is correct; version bump is appropriate.

The error handling at lines 28-30 properly validates the GraphQL response, and the summary export at line 31 is well-structured. The createBlog method is confirmed to exist in the shopify.app.mjs module and is invoked correctly with the required title parameter.

The version bump to 0.0.9 aligns with the broader version updates across the PR.

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

10-10: Version bump looks appropriate.

The patch version increment aligns with the broader package release (0.8.0) that introduces new Shopify actions and features.

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

7-7: Version bump looks appropriate.

The patch version increment is consistent with the package-wide version update strategy.

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

8-8: Version bump looks appropriate.

The patch version increment is consistent with the coordinated package release.

components/shopify/package.json (1)

3-3: Minor version bump is appropriate, but address test failures first.

The minor version increment (0.7.2 → 0.8.0) correctly reflects the addition of new actions and expanded functionality. However, per the PR objectives, reviewer vunguyenhung reported failing test cases across multiple batches:

  • Actions Batch 2, 3, and 4 have issues

These test failures must be resolved before merging to ensure the new components function correctly.

Please review and resolve the test failures documented in the test reports before proceeding with the merge.

components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs (1)

9-9: Version bump looks appropriate.

The patch version increment aligns with the package-wide release strategy.

components/shopify/actions/update-product-variant/update-product-variant.mjs (1)

12-12: Version bump looks appropriate.

The patch version increment is consistent with the coordinated package release.

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

9-9: Version bump looks appropriate.

The patch version increment aligns with the package-wide version update.

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

10-10: Version bump looks appropriate.

The patch version increment is consistent with the coordinated release. Note that the actual new components mentioned in the PR objectives (get-assigned-fulfillment-orders, get-customer, get-customers, get-draft-order, get-draft-orders, get-fulfillment-order, get-fulfillment-orders, search-orders, update-order, etc.) are not included in this review set. Those new components should be reviewed separately to ensure they align with the PR objectives and pass all test cases.

components/shopify/sources/new-product-created/new-product-created.mjs (1)

10-10: LGTM! Coordinated version bump.

This version increment aligns with the broader package updates in this PR. No functional changes detected.

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

7-7: LGTM! Coordinated version bump.

This version increment aligns with the broader package updates in this PR. No functional changes detected.

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

7-7: LGTM! Coordinated version bump.

This version increment aligns with the broader package updates in this PR. No functional changes detected.

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

8-8: LGTM! Coordinated version bump.

This version increment aligns with the broader package updates in this PR. No functional changes detected.

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

12-12: LGTM! Coordinated version bump.

This version increment aligns with the broader package updates in this PR. No functional changes detected.

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

7-7: LGTM! Coordinated version bump.

This version increment aligns with the broader package updates in this PR. No functional changes detected.

components/shopify/actions/update-product/update-product.mjs (1)

9-9: LGTM! Coordinated version bump.

This version increment aligns with the broader package updates in this PR. No functional changes detected.

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

10-10: LGTM! Coordinated version bump.

This version increment aligns with the broader package updates in this PR. No functional changes detected.

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

8-8: Version bump only; action remains consistent with existing behavior.

The version increment is aligned with the broader Shopify package bump; no functional changes or regressions are introduced here.

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

7-7: Delete Blog action version bump looks good.

Metadata update only; runtime behavior and props are unchanged and consistent with existing patterns.

components/shopify/actions/bulk-import/bulk-import.mjs (1)

10-10: Bulk Import version bump is safe.

This is a metadata-only update; the staged upload and bulk operation logic remain untouched.

components/shopify/sources/collection-updated/collection-updated.mjs (1)

9-9: Collection Updated source version bump is fine.

Source behavior, topic, and emitted metadata are unchanged; only the version field is updated.

components/shopify/sources/customer-data-request/customer-data-request.mjs (1)

5-5: Customer Data Request source version bump is appropriate.

No functional changes; existing emit behavior remains intact.

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

8-8: Delete Metafield version bump only.

The action semantics are unchanged; version aligns with the broader package bump.

components/shopify/common/mutations.mjs (1)

418-434: UPDATE_ORDER mutation wiring looks consistent with the new action.

The UPDATE_ORDER mutation expects an OrderInput and returns the order fields your action uses (name, etc.) plus userErrors, and it’s correctly added to the default export for shopify.app to consume.

Also applies to: 460-460

components/shopify/actions/update-order/update-order.mjs (1)

4-53: New Update Order action structure is consistent and clear.

Props, annotations, and use of orderId + optional email, note, tags, and JSON-parsed metafields align with existing Shopify actions and the new UPDATE_ORDER mutation wiring. This should integrate cleanly with the shared shopify.updateOrder helper.

components/shopify/common/queries.mjs (2)

470-624: LGTM: Well-structured order query with proper nested connection handling

The LIST_ORDERS query correctly hard-codes lineItems(first: 50) at line 556 rather than reusing the top-level $first parameter, following Shopify's best practices for managing query complexity. The comprehensive field selection and pagination structure align well with the existing query patterns.


902-997: LGTM: Customer queries correctly use countryCodeV2

Both GET_CUSTOMER and LIST_CUSTOMERS queries properly use countryCodeV2 for address fields, aligning with Shopify's current Admin GraphQL API standards. The field selections are comprehensive and appropriate for customer retrieval operations.

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

8-8: LGTM: Version bump only

The version increment aligns with the broader version updates across the Shopify action suite in this PR.

components/shopify/actions/get-customer/get-customer.mjs (1)

1-36: LGTM: Well-structured customer retrieval action

The action follows the established patterns for Shopify single-resource actions. The info alert appropriately references protected customer data access requirements, and the summary export correctly handles cases where email might be missing.

components/shopify/actions/search-orders/search-orders.mjs (2)

17-21: Review documentation link for order access scope

The info alert references "orders properly defined" but links to protected-customer-data documentation. While orders may contain customer data, the primary access scope concern is read_orders. Consider linking to the general access scopes documentation (https://shopify.dev/docs/admin-api/access-scopes) instead for clarity.


22-51: LGTM: Well-implemented order search action

The action correctly uses the getPaginated pattern with listOrders and properly handles the search query parameter. The summary export correctly pluralizes "order" vs "orders".

components/shopify/actions/get-draft-order/get-draft-order.mjs (1)

29-35: LGTM: Clean single-item draft order fetch

The action correctly fetches a single draft order without unnecessary pagination parameters, and the summary export appropriately falls back from name to id.

components/shopify/actions/get-draft-orders/get-draft-orders.mjs (1)

22-66: LGTM: Comprehensive draft orders list action

The action is well-structured with detailed query syntax documentation at line 25 and proper use of the pagination pattern. The summary export correctly handles singular/plural cases.

components/shopify/actions/get-customers/get-customers.mjs (1)

1-67: LGTM: Well-structured customer list action

The action appropriately references protected customer data requirements in the info alert, uses the correct pagination pattern, and includes helpful query examples. The summary export correctly handles singular/plural cases.

components/shopify/shopify.app.mjs (1)

520-546: GraphQL helper methods are consistent with existing patterns

The new wrappers (listOrders, getDraftOrder, listDraftOrders, updateOrder, getCustomer, listCustomers, listAssignedFulfillmentOrders, getFulfillmentOrder, listFulfillmentOrders) all delegate through _makeGraphQlRequest in the same way as existing helpers (e.g., listProducts, getProduct, etc.), so from an app-facade standpoint this is clean and consistent.

Just ensure the corresponding queries.* and mutations.UPDATE_ORDER constants are defined with the expected shapes (top‑level fields matching the names implied by resourceKeys, and connections exposing nodes/pageInfo) so that downstream usages like getPropOptions and getPaginated continue to work without adjustment.

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@jcortes
Copy link
Collaborator Author

jcortes commented Dec 12, 2025

/approve

@jcortes jcortes force-pushed the shopify-new-components branch from 0d67e74 to 9486f92 Compare December 12, 2025 16:40
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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
components/shopify/actions/create-metafield/create-metafield.mjs (1)

55-70: Fix $summary: it references metafield value type instead of the owner resource type.

Right now it says “for object type ${this.type}”, but ${this.type} is the metafield data type; ${this.ownerResource} is the resource type.

-    $.export("$summary", `Created metafield ${this.name} for object type ${this.type}`);
+    $.export("$summary", `Created metafield ${this.name} for resource type ${this.ownerResource}`);
components/shopify/actions/delete-metafield/delete-metafield.mjs (1)

44-60: Add null check for metafield lookup.

Line 46 uses find() which returns undefined if no matching metafield is found. Accessing metafield.key on line 50 without a null check will cause a runtime error if the metafield doesn't exist (e.g., deleted between prop selection and execution, or manually entered incorrect ID).

Apply this diff to add defensive error handling:

 async run({ $ }) {
   const metafields = await this.listMetafields(this.ownerResource, this.ownerId);
   const metafield = metafields.find(({ id }) => id === this.metafieldId);
+
+  if (!metafield) {
+    throw new Error(`Metafield with ID ${this.metafieldId} not found`);
+  }

   const response = await this.shopify.deleteMetafield({
♻️ Duplicate comments (10)
components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs (2)

30-34: Remove the first: MAX_LIMIT parameter from the getFulfillmentOrder call.

This action fetches a single fulfillment order by ID. Single-item fetch methods like getCustomer, getOrder, and getDraftOrder do not use pagination parameters. The first: MAX_LIMIT parameter is inconsistent with these patterns.

Apply this diff:

   async run({ $ }) {
     const { fulfillmentOrder } = await this.shopify.getFulfillmentOrder({
       id: this.fulfillmentOrderId,
-      first: MAX_LIMIT,
     });

2-2: Remove unused import after fixing pagination parameter.

Once the first: MAX_LIMIT parameter is removed from getFulfillmentOrder, this import will be unused.

Apply this diff:

 import shopify from "../../shopify.app.mjs";
-import { MAX_LIMIT } from "../../common/constants.mjs";
components/shopify/actions/get-draft-order/get-draft-order.mjs (1)

17-21: Incorrect info alert content for draft order action.

The alert mentions "customer data" and links to protected customer data documentation, but this action retrieves draft orders. Update to reference draft orders and link to the appropriate access scopes documentation.

Apply this diff:

     info: {
       type: "alert",
       alertType: "info",
-      content: "Please verify that the Shopify shop has customer data properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)",
+      content: "Please verify that the Shopify shop has draft orders properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/admin-api/access-scopes)",
     },
components/shopify/actions/get-draft-orders/get-draft-orders.mjs (1)

17-21: Update documentation link for draft order access scope.

The alert correctly mentions "draft orders" but links to protected-customer-data documentation. Update the link to point to general access scopes documentation for consistency.

Apply this diff:

     info: {
       type: "alert",
       alertType: "info",
-      content: "Please verify that the Shopify shop has draft orders properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)",
+      content: "Please verify that the Shopify shop has draft orders properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/admin-api/access-scopes)",
     },
components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)

22-28: Update sortKey description to avoid misleading guidance.

The description states "Options: ID" but Shopify's FulfillmentOrderSortKeys may support additional values. Make the description generic or validate that only ID is supported.

Consider updating the description:

-      description: "The key to sort the results by. Options: `ID`",
+      description: "The key to sort the results by. See Shopify docs for valid sort keys.",
components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)

35-41: Update sortKey description to avoid misleading guidance.

The description states "Options: ID" but Shopify's FulfillmentOrderSortKeys enum may expose additional values. Make the description generic or validate and explicitly state if only ID is supported.

Consider updating the description:

-      description: "The key to sort the results by. Options: `ID`",
+      description: "The key to sort the results by. See Shopify docs for valid sort keys.",
components/shopify/common/queries.mjs (2)

782-815: Replace deprecated countryCode with countryCodeV2 in LIST_DRAFT_ORDERS.

In the LIST_DRAFT_ORDERS query, both billingAddress and shippingAddress use the deprecated countryCode field. Shopify's Admin GraphQL API has deprecated this in favor of countryCodeV2. Other queries in this file correctly use countryCodeV2.

Apply this diff:

       billingAddress {
         address1
         address2
         city
         company
         country
-        countryCode
+        countryCodeV2
         firstName
         lastName
         phone
         province
         provinceCode
         zip
         name
         latitude
         longitude
       }
       shippingAddress {
         address1
         address2
         city
         company
         country
-        countryCode
+        countryCodeV2
         firstName
         lastName
         phone
         province
         provinceCode
         zip
         name
         latitude
         longitude
       }

1030-1041: Avoid reusing $first for nested lineItems connections.

The queries LIST_ASSIGNED_FULFILLMENT_ORDERS, GET_FULFILLMENT_ORDER, and LIST_FULFILLMENT_ORDERS reuse the top-level $first parameter for nested lineItems connections, which multiplies query complexity and can cause throttling on large datasets. Per Shopify best practices, hardcode a smaller limit for nested connections (as done in LIST_ORDERS which uses lineItems(first: 50)) or introduce a separate variable.

Apply this diff to hardcode nested limits:

-        lineItems(first: $first) {
+        lineItems(first: 50) {
           nodes {

Also applies to: 1082-1093, 1129-1140

components/shopify/shopify.app.mjs (1)

247-306: Ensure option labels are always present + consider broadening fulfillmentOrderId source

  • Line 251-260 / 266-275 / 281-290: labelKey assumes the GraphQL nodes include name / email. If any query omits those fields, options will render blank.
  • Line 292-306: fulfillmentOrderId is limited to assigned fulfillment orders; if this prop is intended to be generic (“Fulfillment Order ID”), consider sourcing from listFulfillmentOrders instead.

(Second point matches prior feedback; re-surfacing for completeness.)

#!/bin/bash
# Verify LIST_* queries select the fields used as labelKey in propDefinitions.
rg -n --type=js --type=mjs -C2 'LIST_ORDERS|LIST_DRAFT_ORDERS|LIST_CUSTOMERS|LIST_ASSIGNED_FULFILLMENT_ORDERS|LIST_FULFILLMENT_ORDERS' components/shopify/common/queries.mjs
components/shopify/actions/update-order/update-order.mjs (1)

55-83: Harden GraphQL response handling + don’t throw only the first userError

  • Line 77-79: only throwing userErrors[0] is a known papercut; aggregating all messages is much nicer for users.
  • Also consider guarding for unexpected shapes (e.g., response?.orderUpdate missing) before dereferencing response.orderUpdate.userErrors / response.orderUpdate.order.name.

Suggested change (aggregation + safer access):

-    if (response.orderUpdate.userErrors.length > 0) {
-      throw new Error(response.orderUpdate.userErrors[0].message);
-    }
-
-    $.export("$summary", `Successfully updated order \`${response.orderUpdate.order.name}\``);
+    const userErrors = response?.orderUpdate?.userErrors ?? [];
+    if (userErrors.length > 0) {
+      const errorMessages = userErrors
+        .map((e) => `${e.field?.length ? `${e.field.join(".")}: ` : ""}${e.message}`)
+        .join("; ");
+      const err = new Error(errorMessages);
+      err.userErrors = userErrors;
+      throw err;
+    }
+
+    const orderName = response?.orderUpdate?.order?.name ?? this.orderId;
+    $.export("$summary", `Successfully updated order \`${orderName}\``);
     return response;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d67e74 and 9486f92.

📒 Files selected for processing (50)
  • components/shopify/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs (1 hunks)
  • components/shopify/actions/add-tags/add-tags.mjs (1 hunks)
  • components/shopify/actions/bulk-import/bulk-import.mjs (1 hunks)
  • components/shopify/actions/create-article/create-article.mjs (1 hunks)
  • components/shopify/actions/create-blog/create-blog.mjs (1 hunks)
  • components/shopify/actions/create-custom-collection/create-custom-collection.mjs (1 hunks)
  • components/shopify/actions/create-metafield/create-metafield.mjs (1 hunks)
  • components/shopify/actions/create-metaobject/create-metaobject.mjs (1 hunks)
  • components/shopify/actions/create-page/create-page.mjs (1 hunks)
  • components/shopify/actions/create-product-variant/create-product-variant.mjs (1 hunks)
  • components/shopify/actions/create-product/create-product.mjs (1 hunks)
  • components/shopify/actions/create-smart-collection/create-smart-collection.mjs (1 hunks)
  • components/shopify/actions/delete-article/delete-article.mjs (1 hunks)
  • components/shopify/actions/delete-blog/delete-blog.mjs (1 hunks)
  • components/shopify/actions/delete-metafield/delete-metafield.mjs (1 hunks)
  • components/shopify/actions/delete-page/delete-page.mjs (1 hunks)
  • components/shopify/actions/get-articles/get-articles.mjs (1 hunks)
  • components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1 hunks)
  • components/shopify/actions/get-customer/get-customer.mjs (1 hunks)
  • components/shopify/actions/get-customers/get-customers.mjs (1 hunks)
  • components/shopify/actions/get-draft-order/get-draft-order.mjs (1 hunks)
  • components/shopify/actions/get-draft-orders/get-draft-orders.mjs (1 hunks)
  • components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs (1 hunks)
  • components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1 hunks)
  • components/shopify/actions/get-metafields/get-metafields.mjs (1 hunks)
  • components/shopify/actions/get-metaobjects/get-metaobjects.mjs (1 hunks)
  • components/shopify/actions/get-pages/get-pages.mjs (1 hunks)
  • components/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs (1 hunks)
  • components/shopify/actions/search-orders/search-orders.mjs (1 hunks)
  • components/shopify/actions/search-product-variant/search-product-variant.mjs (1 hunks)
  • components/shopify/actions/search-products/search-products.mjs (1 hunks)
  • components/shopify/actions/update-article/update-article.mjs (1 hunks)
  • components/shopify/actions/update-inventory-level/update-inventory-level.mjs (1 hunks)
  • components/shopify/actions/update-metafield/update-metafield.mjs (1 hunks)
  • components/shopify/actions/update-metaobject/update-metaobject.mjs (1 hunks)
  • components/shopify/actions/update-order/update-order.mjs (1 hunks)
  • components/shopify/actions/update-page/update-page.mjs (1 hunks)
  • components/shopify/actions/update-product-variant/update-product-variant.mjs (1 hunks)
  • components/shopify/actions/update-product/update-product.mjs (1 hunks)
  • components/shopify/common/mutations.mjs (2 hunks)
  • components/shopify/common/queries.mjs (2 hunks)
  • components/shopify/package.json (1 hunks)
  • components/shopify/shopify.app.mjs (2 hunks)
  • components/shopify/sources/collection-updated/collection-updated.mjs (1 hunks)
  • components/shopify/sources/customer-data-request/customer-data-request.mjs (1 hunks)
  • components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs (1 hunks)
  • components/shopify/sources/new-article/new-article.mjs (1 hunks)
  • components/shopify/sources/new-event-emitted/new-event-emitted.mjs (1 hunks)
  • components/shopify/sources/new-page/new-page.mjs (1 hunks)
  • components/shopify/sources/new-product-created/new-product-created.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/shopify/actions/get-customers/get-customers.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/shopify/actions/get-draft-order/get-draft-order.mjs
🧬 Code graph analysis (3)
components/shopify/actions/update-order/update-order.mjs (7)
components/shopify/actions/add-tags/add-tags.mjs (1)
  • response (67-70)
components/shopify/actions/create-blog/create-blog.mjs (1)
  • response (23-27)
components/shopify/actions/create-page/create-page.mjs (1)
  • response (28-33)
components/shopify/actions/create-product/create-product.mjs (1)
  • response (72-86)
components/shopify/actions/delete-blog/delete-blog.mjs (1)
  • response (24-26)
components/shopify/actions/delete-metafield/delete-metafield.mjs (1)
  • response (48-54)
components/shopify/actions/delete-page/delete-page.mjs (1)
  • response (24-26)
components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)
components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)
  • fulfillmentOrders (56-68)
components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs (1)
components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs (1)
  • fulfillmentOrders (43-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (45)
components/shopify/actions/update-metaobject/update-metaobject.mjs (1)

5-16: Version bump only; no functional changes observed.
Line 10 updates version to 0.0.9; everything else in this module appears unchanged.

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

8-8: Version bump only (no behavioral change).

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

4-13: Version bump only; LGTM. The update to version: "0.0.9" looks consistent with a metadata-only release.

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

3-13: Version bump looks consistent; no behavioral change in this file.

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

3-12: Version bump only; no functional changes observed.
Looks safe since only the version field changed (Line 7) and runtime logic/props remain identical.

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

10-10: Version bump only — OK.

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

6-8: Version bump only (0.0.8 → 0.0.9); no behavior change observed.

Please just confirm any central registry/manifest (if present in this repo) that tracks action versions is updated/consistent with this bump, so publishing/release automation doesn’t drift.

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

5-15: Version bump only; no behavioral impact detected.

Line 10 updates the action version to 0.0.7; the rest of the action definition and runtime logic is unchanged.

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

4-12: Version bump only; behavior unchanged.

Looks good as a metadata-only change. Please verify this aligns with Pipedream component versioning/release expectations (e.g., whether any changelog or coordinated version bumps are required for Shopify sources in this release).

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

3-14: Version bump only; no behavioral change observed (LGTM).

Just confirm the 0.0.14 bump is coordinated with whatever release/registry process Pipedream uses for Shopify actions (so published versions stay monotonic and consistent across related actions).

components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs (1)

4-11: Version bump only; no behavioral change detected.

Please just double-check that version: "0.0.21" aligns with the repo’s Shopify component release/versioning conventions (and that any required changelog/release metadata updates are handled elsewhere).

components/shopify/sources/new-product-created/new-product-created.mjs (1)

10-10: Version bump is appropriate.

The patch version bump aligns with the PR's broader module updates for expanded Shopify functionality.

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

10-10: Version bump is appropriate.

The minor version increment from 0.0.19 to 0.0.20 aligns with the PR's scope of expanding Shopify functionality and updating the app facade/propDefinitions. The source itself has no functional changes and correctly reuses the common polling infrastructure.

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

7-7: Version bump is appropriate.

The version increment from 0.0.8 to 0.0.9 is consistent with the PR's scope of expanding Shopify action functionality. The action code remains unchanged and correct.

components/shopify/actions/create-metafield/create-metafield.mjs (2)

4-14: Version bump is fine.


7-8: Verify the method/mutation + response shape alignment (createMetafield vs metafieldDefinitionCreate).

The description references metafieldDefinitionCreate, but the wrapper method is this.shopify.createMetafield(...). Please double-check the wrapper actually calls that mutation and consistently returns response.metafieldDefinitionCreate.userErrors (i.e., no mismatch like metafieldCreate / different payload field names).

Also applies to: 55-68

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

7-7: Version bump looks good.

This metadata-only version bump aligns with the broader Shopify integration update in this PR. Standard practice for maintaining version consistency across the package.

components/shopify/actions/update-product/update-product.mjs (1)

9-9: LGTM! Version bump aligns with the package release.

The patch version increment is appropriate for this coordinated release with the new Shopify actions added in the PR.

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

8-8: Version bump is appropriate.

The version increment aligns with the broader updates in this PR.

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

3-8: Version bump to 0.0.9 is consistent with related article operations (create-article, get-articles, delete-article are all 0.0.9).

components/shopify/actions/update-product-variant/update-product-variant.mjs (1)

12-12: Version bump only (0.0.17 → 0.0.18) looks consistent with release discipline.

Optional follow-up while you’re here: the $summary string says “Created new product variant” even though this action updates a variant—worth correcting to avoid UX confusion.

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

9-9: Version bump only (0.0.14 → 0.0.15) — LGTM.

components/shopify/package.json (1)

3-3: Package version bump (0.7.2 → 0.8.0) matches the stated addition of new actions/surface area.

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

8-8: Version bump only (0.0.7 → 0.0.8) — LGTM.

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

7-7: Version bump only (0.0.8 → 0.0.9) — LGTM.

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

7-7: Version bump only (0.0.8 → 0.0.9) — LGTM.

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

10-10: Version bump only (0.0.14 → 0.0.15) — LGTM.

components/shopify/sources/customer-data-request/customer-data-request.mjs (1)

5-5: Version bump only (0.0.14 → 0.0.15) — LGTM.

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

7-7: Version bump only — LGTM.
No functional change observed; metadata update looks consistent.

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

7-7: Version bump only — LGTM.
No logic/control-flow change in the provided diff.

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

7-7: Version bump only — LGTM.
No runtime behavior change in this file.

components/shopify/actions/bulk-import/bulk-import.mjs (1)

10-10: Version bump only — LGTM.
No functional changes in the provided code (version metadata update only).

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

7-7: Version bump only — LGTM.
No behavior change in this module.

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

12-12: Version bump only — LGTM.
No changes to action logic in the provided diff.

components/shopify/sources/collection-updated/collection-updated.mjs (1)

9-9: Version bump only — LGTM.
Source behavior unchanged.

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

10-10: Version bump only — LGTM.
No logic/control-flow change associated with this diff.

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

10-10: LGTM!

Version bump aligns with the broader PR updates for Shopify components.

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

8-8: LGTM!

Version bump is consistent with the PR's component updates.

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

8-8: LGTM!

Version bump is consistent with the PR's component updates.

components/shopify/common/mutations.mjs (2)

418-434: LGTM!

The UPDATE_ORDER mutation follows the established pattern in this file: proper input typing with OrderInput!, returns essential order fields for confirmation, and includes userErrors for error handling.


460-460: LGTM!

Export properly added.

components/shopify/actions/get-customer/get-customer.mjs (2)

3-13: LGTM!

Action metadata is well-defined. The readOnlyHint: true annotation correctly reflects that this is a read-only GET operation.


14-28: LGTM!

The info alert providing guidance on customer data access scope requirements is a good UX practice for actions that may require special permissions.

components/shopify/actions/get-customers/get-customers.mjs (1)

1-67: LGTM!

The action correctly implements customer retrieval with appropriate pagination, proper alert content for customer data access, and consistent summary formatting.

components/shopify/shopify.app.mjs (1)

520-546: Thin GraphQL wrappers look consistent with existing app surface
The new methods (listOrders, getDraftOrder, updateOrder, etc.) follow the same _makeGraphQlRequest(query, variables) pattern as the rest of the module, which keeps the public API predictable.

@jcortes
Copy link
Collaborator Author

jcortes commented Dec 12, 2025

/approve

@jcortes jcortes merged commit da3b9b7 into master Dec 12, 2025
9 checks passed
@jcortes jcortes deleted the shopify-new-components branch December 12, 2025 17:58
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.

[ACTION] Shopify - expand functionality

4 participants