Browse Source

fix(admin-ui): Fix handling of Country custom fields

Michael Bromley 2 years ago
parent
commit
3538beef65

+ 5 - 0
packages/admin-ui/src/lib/core/src/data/utils/add-custom-fields.ts

@@ -28,6 +28,11 @@ export function addCustomFields(documentNode: DocumentNode, customFields: Custom
             entityType = 'Address';
         }
 
+        if (entityType === ('Country' as any)) {
+            // Country is an alias of Region
+            entityType = 'Region';
+        }
+
         const customFieldsForType = customFields[entityType];
         if (customFieldsForType && customFieldsForType.length) {
             (fragmentDef.selectionSet.selections as SelectionNode[]).push({