-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Shopify extend the get-order tool, new search-orders action #17293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update introduces a new "Search for Orders" action to the Shopify Developer App and enhances existing GraphQL queries to provide richer customer and pricing information for orders and customers. Additionally, version numbers are incremented across multiple actions and sources, and the package version is updated. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SearchOrdersAction
participant ShopifyApp
participant ShopifyAPI
User->>SearchOrdersAction: Provide query and max (optional)
SearchOrdersAction->>ShopifyApp: getPaginated(listOrders, {query, max})
ShopifyApp->>ShopifyAPI: GraphQL LIST_ORDERS(query, max)
ShopifyAPI-->>ShopifyApp: Orders with customer and price details
ShopifyApp-->>SearchOrdersAction: Orders list
SearchOrdersAction-->>User: Return orders, summary, and details
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/shopify_developer_app/actions/add-tags/add-tags.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/shopify_developer_app/actions/create-article/create-article.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (17)
components/shopify_developer_app/sources/new-order-fulfilled/new-order-fulfilled.mjs (1)
9-9
: Version bump looks good – consider updating release notesThe minor version increment is consistent with the rest of the PR and poses no functional risk.
If you maintain a CHANGELOG or release notes, remember to reflect this bump to keep downstream consumers informed.components/shopify_developer_app/sources/new-article/new-article.mjs (1)
14-14
: Minor version increment acknowledgedNothing else changed in the module, so this is safe to merge.
As above, ensure any public documentation is updated for the new0.0.7
tag.components/shopify_developer_app/actions/create-order/create-order.mjs (1)
8-8
: Remember to document the new versionOnly the metadata was updated. Please ensure the CHANGELOG (or equivalent release notes) reflects
0.0.7
, otherwise consumers may be confused about what actually changed.components/shopify_developer_app/actions/search-products/search-products.mjs (1)
14-14
: Version bump looks fine – confirm repo-wide consistencyThe minor bump to
0.0.7
is reasonable. Double-check that:
package.json
(root of this module) has been bumped to the same/compatible version.- Any public docs/CHANGELOG mention the new version.
No other issues spotted.
components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs (1)
14-14
: Minor version increment acknowledgedSame note as above – ensure the accompanying metadata (package.json, CHANGELOG) was updated.
No functional changes detected.components/shopify_developer_app/actions/update-product-variant/update-product-variant.mjs (1)
14-14
: Patch bump to 0.0.9 validatedLGTM. Verify this stays in sync with any automation that detects latest action versions.
components/shopify_developer_app/sources/new-draft-order/new-draft-order.mjs (1)
9-9
: Source version bumped — remember to refresh event source docsNothing else changed. Make sure external integrations referencing the version number (if any) are updated.
components/shopify_developer_app/sources/new-event-emitted/new-event-emitted.mjs (1)
10-10
: Increment to 0.0.12 confirmedNo functional impact. Same housekeeping reminders as above (CHANGELOG, docs).
components/shopify_developer_app/package.json (1)
3-3
: Package version bump is reasonable
Moving to0.8.0
reflects the new action addition and multiple minor updates. Ensure CHANGELOG entry accompanies this.components/shopify_developer_app/actions/update-customer/update-customer.mjs (1)
8-10
: Tiny copy edit to the description
"Update a existing customer"
→"Update an existing customer"
for correct grammar.- description: "Update a existing customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerupdate)", + description: "Update an existing customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerupdate)",components/shopify_developer_app/actions/get-articles/get-articles.mjs (1)
14-14
: Add a matching CHANGELOG entry for the patch bumpThe code change is limited to the version field. Please ensure the project‐level changelog or release notes include an entry for
shopify_developer_app-get-articles
→0.0.9
, so consumers understand what shipped with this patch.components/shopify_developer_app/sources/new-cancelled-order/new-cancelled-order.mjs (1)
9-9
: Document the0.0.11
source bumpSame as with the actions, consider adding a short note in the changelog (or equivalent) indicating that
new-cancelled-order
moved from0.0.10
to0.0.11
, even if functional behaviour is unchanged. It helps downstream integrators verify they picked up the latest build.components/shopify_developer_app/actions/update-metafield/update-metafield.mjs (1)
12-12
: update-metafield version bumpPatch bump to
0.0.8
approved. No logic touched.
While you’re here, consider adding a CHANGELOG entry summarising the new search-orders feature so consumers see why the overall package jumped.components/shopify_developer_app/sources/new-order-created/new-order-created.mjs (1)
8-10
: Version bump looks correct – remember to update CHANGELOG.Patch-level increment to
0.0.11
is consistent with the coordinated release shown across the PR. No further action required here, but don’t forget to record the change in the component-level CHANGELOG for traceability.components/shopify_developer_app/actions/create-product-variant/create-product-variant.mjs (1)
12-15
: Version bumped to 0.0.8 – LGTM.Change is purely semantic. Make sure this stays in sync with any external docs or sample code that hard-codes the previous version.
components/shopify_developer_app/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs (1)
12-15
: Version update noted.Everything else unchanged. Consider adding a unit test or smoke test to ensure the source still emits events after the multi-file version bump rollout.
components/shopify_developer_app/actions/search-orders/search-orders.mjs (1)
11-22
: Consider adding basic input validation.While the Shopify API will handle invalid inputs, consider adding basic validation to improve user experience:
query: { type: "string", label: "Query", description: "The search query", optional: true, + validate: (value) => { + if (value !== undefined && value.trim() === "") { + throw new Error("Query cannot be empty string"); + } + }, }, max: { type: "integer", label: "Max Records", description: "Optionally limit the maximum number of records to return. Leave blank to retrieve all records.", optional: true, + min: 1, },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (54)
components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs
(1 hunks)components/shopify_developer_app/actions/add-tags/add-tags.mjs
(1 hunks)components/shopify_developer_app/actions/create-article/create-article.mjs
(1 hunks)components/shopify_developer_app/actions/create-blog/create-blog.mjs
(1 hunks)components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs
(1 hunks)components/shopify_developer_app/actions/create-customer/create-customer.mjs
(1 hunks)components/shopify_developer_app/actions/create-metafield/create-metafield.mjs
(1 hunks)components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs
(1 hunks)components/shopify_developer_app/actions/create-order/create-order.mjs
(1 hunks)components/shopify_developer_app/actions/create-page/create-page.mjs
(1 hunks)components/shopify_developer_app/actions/create-product-variant/create-product-variant.mjs
(1 hunks)components/shopify_developer_app/actions/create-product/create-product.mjs
(1 hunks)components/shopify_developer_app/actions/create-smart-collection/create-smart-collection.mjs
(1 hunks)components/shopify_developer_app/actions/delete-article/delete-article.mjs
(1 hunks)components/shopify_developer_app/actions/delete-blog/delete-blog.mjs
(1 hunks)components/shopify_developer_app/actions/delete-metafield/delete-metafield.mjs
(1 hunks)components/shopify_developer_app/actions/delete-page/delete-page.mjs
(1 hunks)components/shopify_developer_app/actions/get-articles/get-articles.mjs
(1 hunks)components/shopify_developer_app/actions/get-metafields/get-metafields.mjs
(1 hunks)components/shopify_developer_app/actions/get-metaobjects/get-metaobjects.mjs
(1 hunks)components/shopify_developer_app/actions/get-order/get-order.mjs
(1 hunks)components/shopify_developer_app/actions/get-pages/get-pages.mjs
(1 hunks)components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs
(1 hunks)components/shopify_developer_app/actions/search-customers/search-customers.mjs
(1 hunks)components/shopify_developer_app/actions/search-orders/search-orders.mjs
(1 hunks)components/shopify_developer_app/actions/search-product-variant/search-product-variant.mjs
(1 hunks)components/shopify_developer_app/actions/search-products/search-products.mjs
(1 hunks)components/shopify_developer_app/actions/update-article/update-article.mjs
(1 hunks)components/shopify_developer_app/actions/update-customer/update-customer.mjs
(1 hunks)components/shopify_developer_app/actions/update-inventory-level/update-inventory-level.mjs
(1 hunks)components/shopify_developer_app/actions/update-metafield/update-metafield.mjs
(1 hunks)components/shopify_developer_app/actions/update-metaobject/update-metaobject.mjs
(1 hunks)components/shopify_developer_app/actions/update-page/update-page.mjs
(1 hunks)components/shopify_developer_app/actions/update-product-variant/update-product-variant.mjs
(1 hunks)components/shopify_developer_app/actions/update-product/update-product.mjs
(1 hunks)components/shopify_developer_app/common/queries.mjs
(3 hunks)components/shopify_developer_app/package.json
(1 hunks)components/shopify_developer_app/sources/new-abandoned-cart/new-abandoned-cart.mjs
(1 hunks)components/shopify_developer_app/sources/new-article/new-article.mjs
(1 hunks)components/shopify_developer_app/sources/new-cancelled-order/new-cancelled-order.mjs
(1 hunks)components/shopify_developer_app/sources/new-customer-created/new-customer-created.mjs
(1 hunks)components/shopify_developer_app/sources/new-draft-order/new-draft-order.mjs
(1 hunks)components/shopify_developer_app/sources/new-event-emitted/new-event-emitted.mjs
(1 hunks)components/shopify_developer_app/sources/new-fulfillment-event/new-fulfillment-event.mjs
(1 hunks)components/shopify_developer_app/sources/new-order-created/new-order-created.mjs
(1 hunks)components/shopify_developer_app/sources/new-order-fulfilled/new-order-fulfilled.mjs
(1 hunks)components/shopify_developer_app/sources/new-page/new-page.mjs
(1 hunks)components/shopify_developer_app/sources/new-paid-order/new-paid-order.mjs
(1 hunks)components/shopify_developer_app/sources/new-product-created/new-product-created.mjs
(1 hunks)components/shopify_developer_app/sources/new-product-updated/new-product-updated.mjs
(1 hunks)components/shopify_developer_app/sources/new-refund-created/new-refund-created.mjs
(1 hunks)components/shopify_developer_app/sources/new-updated-customer/new-updated-customer.mjs
(1 hunks)components/shopify_developer_app/sources/new-updated-order/new-updated-order.mjs
(1 hunks)components/shopify_developer_app/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (45)
components/shopify_developer_app/sources/new-product-created/new-product-created.mjs (1)
9-9
: Version bump looks correct and consistent with other modules
No functional changes introduced—only the version string moves to0.0.11
, matching the global package bump. ✅components/shopify_developer_app/actions/add-tags/add-tags.mjs (1)
14-14
: Consistent version bumpNo logic changes detected. 👍
Confirm that any automated publishing pipeline recognises the new0.0.7
version so that it is actually released.components/shopify_developer_app/actions/create-metafield/create-metafield.mjs (1)
13-13
: Metafield action version updated
0.0.8
aligns with related metafield actions. Looks good.components/shopify_developer_app/actions/create-smart-collection/create-smart-collection.mjs (1)
14-14
: Smart-collection action bumped to 0.0.7No concerns. Merge when ready.
components/shopify_developer_app/actions/delete-metafield/delete-metafield.mjs (1)
12-12
: Version increment looks good.The version bump from "0.0.7" to "0.0.8" aligns with the coordinated release across multiple Shopify Developer App components.
components/shopify_developer_app/common/queries.mjs (5)
17-30
: Good enhancement to customer data retrieval.The addition of comprehensive customer information including contact details and addresses will provide richer data for order queries. The structure follows GraphQL best practices.
31-40
: Pricing information enhancement looks solid.Adding both shop money and presentment money with currency codes provides comprehensive pricing data for different contexts (internal vs customer-facing).
131-132
: Query parameter addition enables order filtering.The addition of the
$query
parameter to the LIST_ORDERS query enables the new search-orders functionality mentioned in the PR objectives.
136-159
: Consistent data structure across order queries.Good consistency in applying the same customer and pricing enhancements to both GET_ORDER and LIST_ORDERS queries. This ensures uniform data availability across different order retrieval methods.
205-219
: Customer query enhancements add valuable context.The addition of contact information, addresses, and order history to customer queries provides a more complete customer profile. The nested orders query with id and createdAt gives useful order context.
components/shopify_developer_app/actions/search-customers/search-customers.mjs (1)
7-7
: Version increment aligns with enhanced customer data.The version bump from "0.0.6" to "0.0.7" is appropriate, and this action will now return richer customer data thanks to the enhanced LIST_CUSTOMERS query.
components/shopify_developer_app/sources/new-product-updated/new-product-updated.mjs (1)
8-8
: Version increment maintains release consistency.The version bump from "0.0.8" to "0.0.9" aligns with the coordinated release pattern across the Shopify Developer App components.
components/shopify_developer_app/actions/update-product/update-product.mjs (1)
9-9
: Version increment completes coordinated release.The version bump from "0.0.7" to "0.0.8" maintains consistency with the coordinated release across all Shopify Developer App components.
components/shopify_developer_app/actions/create-customer/create-customer.mjs (1)
7-7
: Version bump looks goodNo functional code touched. Increment to
0.0.7
keeps semantic-versioning cadence with other actions.components/shopify_developer_app/sources/new-fulfillment-event/new-fulfillment-event.mjs (1)
9-9
: Version bump acknowledgedUpdate to
0.0.9
aligns this source with the component-wide release. Nothing else to flag.components/shopify_developer_app/actions/get-order/get-order.mjs (1)
8-8
: Minor version bump acceptedThe shift to
0.0.5
is consistent with enriched query data added elsewhere. Implementation unchanged.components/shopify_developer_app/sources/new-refund-created/new-refund-created.mjs (1)
8-8
: Patch-level increment OK
0.0.8
update matches the synchronized version sweep across sources.components/shopify_developer_app/actions/create-blog/create-blog.mjs (1)
14-14
: Version bump verifiedRaising to
0.0.9
with no logic changes—consistent with peer actions.components/shopify_developer_app/actions/delete-blog/delete-blog.mjs (1)
14-14
: Version increment looks goodPatch-level bump is consistent with the package.json update and no functional code was changed.
components/shopify_developer_app/actions/get-metafields/get-metafields.mjs (1)
11-11
: Patch bump acknowledgedNo issues spotted; version
0.0.8
keeps parity with surrounding actions.components/shopify_developer_app/actions/update-inventory-level/update-inventory-level.mjs (1)
14-14
: Consistent version bumpLooks correct and in line with the overall 0.8.0 package release.
components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs (1)
14-14
: Minor version bump notedAll good; just make sure automated publishing picks up
0.0.7
.components/shopify_developer_app/actions/update-metaobject/update-metaobject.mjs (1)
14-14
: Version bump looks correct and consistent
Matches the coordinated 0.8.0 component release. No other changes detected.components/shopify_developer_app/sources/new-paid-order/new-paid-order.mjs (1)
9-9
: Increment aligns with other source updates
0.0.11
keeps parity with sibling sources bumped in this PR. Good to go.components/shopify_developer_app/sources/new-updated-customer/new-updated-customer.mjs (1)
9-9
: Consistent version advancement
0.0.11
matches the pattern; no functional changes introduced.components/shopify_developer_app/sources/new-page/new-page.mjs (1)
14-14
: Minor version update confirmed
0.0.7
keeps source versions aligned; nothing else to flag.components/shopify_developer_app/actions/create-product/create-product.mjs (1)
14-14
: Version bump LGTMPatch-level increment (
0.0.6
→0.0.7
) is in line with the coordinated release across actions. Nothing else changed, so no further review remarks.components/shopify_developer_app/actions/update-customer/update-customer.mjs (1)
9-9
: Version bump looks goodIncrement to
0.0.8
keeps semantic continuity with other customer actions.components/shopify_developer_app/actions/get-pages/get-pages.mjs (1)
14-14
: Version update acknowledged
0.0.8
→0.0.9
aligns with the rest of the page-related actions.components/shopify_developer_app/actions/update-page/update-page.mjs (1)
14-14
: Consistent version bump
0.0.8
→0.0.9
applied; no logic touched.components/shopify_developer_app/actions/get-metaobjects/get-metaobjects.mjs (1)
14-14
: Patch-level increment verified
0.0.7
→0.0.8
is coherent with other metaobject actions.components/shopify_developer_app/actions/delete-article/delete-article.mjs (1)
14-14
: Patch version increment acknowledgedNo concerns with the bump itself; just make sure the mono-repo tooling (if any) that auto-generates docs or tags gets this
0.0.9
reflected.components/shopify_developer_app/actions/update-article/update-article.mjs (1)
14-14
: Consistency checkAll article-related actions appear to be moving to
0.0.9
. Confirm the dependent workflow definitions (if version-pinned) have been updated too, to avoid mismatched imports.components/shopify_developer_app/actions/delete-page/delete-page.mjs (1)
14-14
: LGTM – version bump onlyNothing else changed; safe to merge.
components/shopify_developer_app/sources/new-abandoned-cart/new-abandoned-cart.mjs (1)
14-14
: Version bump acknowledgedPatch-level increase from
0.0.7
→0.0.8
is fine and keeps semantic-versioning order.
Confirm that:
components/shopify_developer_app/package.json
lists"version": "0.8.0"
(looks consistent per PR notes).- Any docs / changelog entries referencing
new-abandoned-cart
are updated accordingly.No functional impact detected.
components/shopify_developer_app/actions/create-article/create-article.mjs (1)
14-14
: create-article: patch bump ok
0.0.8
→0.0.9
is purely bookkeeping.
Double-check that all sibling action versions were bumped together so the marketplace displays a coherent set.components/shopify_developer_app/actions/create-page/create-page.mjs (1)
14-14
: create-page: version updatedLooks good. Same verification checklist as the other actions (docs + package.json alignment).
components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs (1)
14-14
: create-metaobject: version sync
0.0.9
is in line with related metaobject actions. All good.components/shopify_developer_app/actions/search-product-variant/search-product-variant.mjs (1)
12-15
: Patch version increment acknowledged.
version: "0.0.7"
aligns with the project-wide bump. Ensure the parent package.json and any auto-publish scripts pick this up so the new action version is actually published.components/shopify_developer_app/sources/new-updated-order/new-updated-order.mjs (1)
8-10
: Consistent version update – good.No behavioral change introduced; just confirm downstream consumers (workflows relying on exact version strings) are tolerant of the bump.
components/shopify_developer_app/sources/new-customer-created/new-customer-created.mjs (1)
9-9
: Version bump looks good.Routine version increment as part of coordinated updates across the Shopify Developer App components.
components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs (1)
14-14
: Version bump approved.Standard version increment maintaining consistency with other component updates in this PR.
components/shopify_developer_app/actions/search-orders/search-orders.mjs (3)
1-23
: Well-structured action metadata and props.The action is properly structured with clear metadata, descriptive props, and follows established patterns for Shopify Developer App actions.
24-39
: Solid implementation following established patterns.The implementation correctly:
- Uses the
getPaginated
method for handling large result sets- Passes optional query and max parameters appropriately
- Returns orders array with helpful summary export
- Handles singular/plural formatting in the summary
6-6
: Verify documentation link accuracy.Please confirm that the Shopify documentation link is current and correctly points to the orders GraphQL query documentation.
Does the Shopify Admin GraphQL API documentation exist at https://shopify.dev/docs/api/admin-graphql/latest/queries/orders and provide information about querying orders?
LGTM! |
Resolves #17233
Summary by CodeRabbit
New Features
Improvements
Chores