Skip to content

[Dashboard] Fulfillment customFields still broken in 3.6.1 despite PR #4386 fix #4639

@Doulami

Description

@Doulami

Here's the complete issue body to paste:


Hi!

Firstly, thanks for your work on this project!

Today I used patch-package to patch @vendure/dashboard@3.6.1 for the project I'm working on.

The Problem

When custom fields are defined on the Fulfillment entity, the dashboard's ModifyOrder mutation fails with:

GraphQL Request Error: Field "customFields" of type "FulfillmentCustomFields" must have a selection of subfields. Did you mean "customFields { ... }"?

The built-in fulfillmentFragment has a bare customFields without subfield selection. The addCustomFields() function only injects subfields into top-level fragments, but Fulfillment is a nested fragment (used inside OrderDetail), so it doesn't get processed.

Steps to reproduce:

  1. Define custom fields on Fulfillment entity in a plugin
  2. Go to an order with fulfillments in the dashboard
  3. Click "Modify" → "Preview changes"
  4. Error appears

Here is the diff that solved my problem:

diff --git a/node_modules/@vendure/dashboard/src/app/routes/_authenticated/_orders/orders.graphql.ts b/node_modules/@vendure/dashboard/src/app/routes/_authenticated/_orders/orders.graphql.ts
index f396081..9fce543 100644
--- a/node_modules/@vendure/dashboard/src/app/routes/_authenticated/_orders/orders.graphql.ts
+++ b/node_modules/@vendure/dashboard/src/app/routes/_authenticated/_orders/orders.graphql.ts
@@ -97,7 +97,18 @@ export const fulfillmentFragment = graphql(`
             quantity
         }
         trackingCode
-        customFields
+        customFields {
+            afexBarcode
+            actualCarrierUsed
+            originalShippingMethod
+            afexZones
+            carrierCode
+            wavesoftCode
+            manifestedAt
+            numberOfPackages
+            serviceType

<img width="1239" height="799" alt="Image" src="https://github.com/user-attachments/assets/b093536a-bb53-4eff-bb1f-0adc29d400a0" />

<img width="609" height="924" alt="Image" src="https://github.com/user-attachments/assets/405b6d65-bc99-4ba4-9cca-67f326bb545c" />
<img width="1239" height="799" alt="Image" src="https://github.com/user-attachments/assets/24f5116c-1258-492d-8219-50f10abf4c4e" />

+        }
     }
 `);

Suggested fix: Either update addCustomFields() to process nested fragments like Fulfillment, or add Fulfillment to includeNestedFragments when building order-related queries.

This issue body was partially generated by patch-package.

Note: I see PR #4386 already added 'Fulfillment' to includeNestedFragments in multiple loaders, but the issue persists in 3.6.1. The addCustomFields() transformation doesn't seem to be working for nested fragments even with this setting.


Submit at: https://github.com/vendure-ecommerce/vendure/issues/new

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions