Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion data/ShopifyTemplateData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,29 @@
<fileData>
<![CDATA[<#ftl output_format="HTML">
<@compress single_line=true>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we exclude more than one status ?

excludeStatus(List)

If more than one status can be excluded, then name the variable excludeStatusList else excludeStatus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shopify supports multiple conditions,
but it does not support operators like in or not-in.

If we want to accept a list excluded status,
then we’ll need to join it using the OR or AND operator.

Example:
Suppose the excluded list has OPEN and CLOSED statuses.
In that case, we need to prepare the query as: query: "-status:OPEN AND -status:CLOSED"

Copy link
Contributor Author

@puru-khedre puru-khedre Sep 16, 2025

Choose a reason for hiding this comment

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

I agree that, instead of being tied to just one status, having an excludeStatus list would allow for better handling.

<#assign query = ""/>
<#assign excludedQuery = "">
<#if excludedStatus?has_content>
<#assign parts = []>
<#list excludedStatus as st>
<#assign parts = parts + ["-status:${st}"]>
</#list>
<#if parts?size &gt; 0>
<#assign excludedQuery = parts?join(" AND ")>
</#if>
<#assign query = "${excludedQuery}"/>
</#if>
<#if assignedLocationId?has_content>
<#assign query = "${query} assigned_location_id:${assignedLocationId}"/>
</#if>
query{
node(id: "${shopifyOrderId}") {
id
... on
Order {
id
name
fulfillmentOrders (first: 10<#if cursor?has_content>, after: "${cursor}"</#if>) {
fulfillmentOrders (first: 10<#if cursor?has_content>, after: "${cursor}"</#if>, query: "${query}") {
edges {
node {
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ under the License.
<parameter name="systemMessageRemoteId" required="true"/>
<parameter name="shopifyOrderId" required="true"/>
<parameter name="includeFulfillmentLineItems" type="Boolean" default-value="true"/>
<parameter name="excludedStatus" type="List"/>
<parameter name="assignedLocationId"/>
</in-parameters>
<out-parameters>
<parameter name="fulfillmentOrdersByOrderId"/>
Expand All @@ -375,6 +377,7 @@ under the License.
<set field="fulfillmentOrdersByOrderId" from="[:]"/>
<set field="hasNextPage" type="Boolean" value="true"/>
<set field="fulfillmentOrders" from="[]"/>
<set field="assignedLocationId" from="co.hotwax.sob.shopify.ShopifyHelper.resolveShopifyGid(assignedLocationId)"/>
<while condition="hasNextPage">
<script>
queryText = ec.resourceFacade.template("dbresource://shopify/template/graphQL/FulfillmentOrdersByOrderIdQuery.ftl", "")
Expand Down
48 changes: 48 additions & 0 deletions upgrade/UpcomingRelease/UpgradeData.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-facade-xml type="ext-upgrade">
<moqui.resource.DbResource filename="FulfillmentOrdersByOrderIdQuery.ftl" isFile="Y" resourceId="FulfillmentOrdersByOrderIdQuery"
parentResourceId="GraphQL">
<file mimeType="text/html" versionName="01" rootVersionName="01">
<fileData>
<![CDATA[<#ftl output_format="HTML">
<@compress single_line=true>
<#assign query = ""/>
<#assign excludedQuery = "">
<#if excludedStatus?has_content>
<#assign parts = []>
<#list excludedStatus as st>
<#assign parts = parts + ["-status:${st}"]>
</#list>
<#if parts?size &gt; 0>
<#assign excludedQuery = parts?join(" AND ")>
</#if>
<#assign query = "${excludedQuery}"/>
</#if>
<#if assignedLocationId?has_content>
<#assign query = "${query} assigned_location_id:${assignedLocationId}"/>
</#if>
query{
node(id: "${shopifyOrderId}") {
id
... on
Order {
id
name
fulfillmentOrders (first: 10<#if cursor?has_content>, after: "${cursor}"</#if>, query: "${query}") {
edges {
node {
id
}
}
pageInfo{
endCursor
hasNextPage
}
}
}
}
}
</@compress>]]>
</fileData>
<histories versionName="01" previousVersionName="01"/>
</file>
</moqui.resource.DbResource>

</entity-facade-xml>