-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Enhance Shopify order queries with complete order data including line items #17611
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
Enhance Shopify order queries with complete order data including line items #17611
Conversation
… items - Updated GET_ORDER query to include comprehensive order information: - Complete line items with product and variant details - Shipping and billing addresses - Fulfillment tracking information - Payment transactions and refunds - Tax lines and discount allocations - All financial breakdowns (subtotal, shipping, tax, discounts) - Updated LIST_ORDERS query to include: - Line items with product information - Order status and fulfillment details - Customer and shipping information - Essential financial data This provides complete order data including all items, customer info, shipping details, and fulfillment tracking when retrieving orders.
@seynadio is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
WalkthroughThis update consists primarily of version number increments across a wide range of action and source modules within the Shopify developer app, reflecting minor, non-functional changes. Additionally, the GraphQL queries for orders have been significantly expanded and refactored, introducing broader and deeper data retrieval for order and customer information. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ShopifyApp
participant ShopifyAPI
Client->>ShopifyApp: Request order details (GetOrder)
ShopifyApp->>ShopifyAPI: Send expanded GetOrder GraphQL query
ShopifyAPI-->>ShopifyApp: Return comprehensive order, customer, line item, fulfillment, transaction, and refund data
ShopifyApp-->>Client: Respond with detailed order information
Estimated code review effort2 (~20 minutes) 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/common/queries.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ 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)
🔇 Additional comments (4)
✨ 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 (
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
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: 2
🧹 Nitpick comments (2)
components/shopify_developer_app/common/queries.mjs (2)
1-468
: Consider performance implications of the expanded query.The
GET_ORDER
query now fetches comprehensive order data with multiple levels of nested fields and pagination. This could lead to:
- Increased response times for orders with many line items, fulfillments, or transactions
- Higher memory usage and potential timeouts
- Unnecessary data transfer if all fields aren't always needed
Consider implementing field selection based on specific use cases or creating multiple focused queries for different scenarios.
624-624
: Inconsistent line items limit between queries.The
LIST_ORDERS
query fetches only 50 line items per order whileGET_ORDER
fetches 250. This inconsistency might cause confusion. If this is intentional for performance reasons in list views, consider adding a comment to document this decision.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/shopify_developer_app/common/queries.mjs
(4 hunks)
🔇 Additional comments (2)
components/shopify_developer_app/common/queries.mjs (2)
25-89
: Well-structured money amount fields.The consistent implementation of price sets with both
shopMoney
andpresentmentMoney
throughout the queries is excellent. This ensures proper multi-currency support across all monetary values.Also applies to: 162-193, 284-317, 359-368, 388-397, 413-432, 441-450, 554-593, 633-642
2-2
: Update usages for renamed GetOrder queryThe GraphQL query has been renamed from
SuggestedRefund
toGetOrder
. There is no$refundLineItems
variable—refundLineItems
remains a nested field in the query, not a removed parameter.Our
rg
search over.js
,.ts
, and.mjs
files found:
- No occurrences of
SuggestedRefund
- No references to a
$refundLineItems
variablePlease verify:
- Any code (including
.svelte
,.vue
, backend services, tests, etc.) importing or invoking the oldSuggestedRefund
query is updated toGetOrder
- The new GraphQL variables (
$id
,$first
,$after
) are passed correctly where this query is used
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.
Thank you for your contribution! Ready for QA!
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check the test report below for more information |
- Replace deprecated acceptsMarketing with emailMarketingConsent in Customer object - Update ProductVariant weight fields to use inventoryItem.measurement.weight structure - Replace requestedFulfillmentServiceId with requestedFulfillmentService object - Update fulfillment service object to include correct fields (id, serviceName, handle) These changes align with the current Shopify GraphQL API schema and fix the "Field doesn't exist" errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check the test report below for more information |
Fix selectionMismatch error by removing emailMarketingConsent from customer queries in GET_ORDER and LIST_ORDERS. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
fca708a
to
b93534d
Compare
a185f1b
to
b93534d
Compare
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: 3
🔭 Outside diff range comments (1)
components/shopify_developer_app/common/queries.mjs (1)
359-390
: Transactions query missing pagination structure.The transactions field uses
first: 250
but lacks the standard GraphQL connection structure withedges
,node
, andpageInfo
. This is inconsistent with other paginated fields in the query.Fix the transactions structure to follow GraphQL connection pattern:
- transactions(first: 250) { - id - status - kind - gateway - test - createdAt - processedAt - amountSet { - shopMoney { - amount - currencyCode - } - presentmentMoney { - amount - currencyCode - } - } - fees { - amount { - amount - currencyCode - } - flatFee { - amount - currencyCode - } - rate - rateName - type - } - } + transactions(first: 250) { + edges { + node { + id + status + kind + gateway + test + createdAt + processedAt + amountSet { + shopMoney { + amount + currencyCode + } + presentmentMoney { + amount + currencyCode + } + } + fees { + amount { + amount + currencyCode + } + flatFee { + amount + currencyCode + } + rate + rateName + type + } + } + } + pageInfo { + hasNextPage + endCursor + } + }
♻️ Duplicate comments (3)
components/shopify_developer_app/common/queries.mjs (3)
2-2
: Query signature uses conflicting pagination parameters.The
$first
and$after
parameters are designed for the main order query but are being reused for nested metafields pagination, which can cause conflicts and prevent independent pagination control.This issue was already identified in previous reviews but hasn't been addressed yet.
147-281
: Line items query lacks pagination info despite high item limit.The line items are fetched with a high limit (250) but without
pageInfo
, making it impossible to detect if there are more items beyond this limit. This could lead to incomplete data retrieval for orders with many line items.This pagination issue was flagged in previous reviews but remains unaddressed.
631-677
: LIST_ORDERS line items missing pagination info.This is the same pagination issue identified in previous reviews for the LIST_ORDERS query line items.
🧹 Nitpick comments (1)
components/shopify_developer_app/common/queries.mjs (1)
1-476
: Query complexity may impact performance.The expanded GET_ORDER query now retrieves an extensive amount of nested data including detailed product information, variant details, fulfillments, transactions, and refunds. This comprehensive approach, while providing complete data, may result in slower response times and higher API rate limit consumption.
Consider implementing query fragments or separate specialized queries for different use cases to optimize performance:
// Example: Separate fragments for different data needs const ORDER_BASIC_FRAGMENT = ` fragment OrderBasic on Order { id name createdAt updatedAt displayFinancialStatus displayFulfillmentStatus totalPriceSet { shopMoney { amount currencyCode } presentmentMoney { amount currencyCode } } } `; const ORDER_DETAILED_FRAGMENT = ` fragment OrderDetailed on Order { ...OrderBasic lineItems(first: 250) { edges { node { /* detailed fields */ } } pageInfo { hasNextPage endCursor } } fulfillments { /* detailed fields */ } transactions { /* detailed fields */ } } `;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/shopify_developer_app/common/queries.mjs
(4 hunks)
⏰ 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: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check the test report below for more information |
Hi everyone, all test cases are passed! Ready for release! |
Summary
Summary by CodeRabbit
New Features
Chores