Sfoglia il codice sorgente

test(core): Fix failing unit tests

Michael Bromley 5 anni fa
parent
commit
b165b0d678
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 6 4
      packages/core/src/api/config/graphql-custom-fields.ts

+ 6 - 4
packages/core/src/api/config/graphql-custom-fields.ts

@@ -179,11 +179,13 @@ export function addGraphQLCustomFields(
             `;
         }
     } else {
-        customFieldTypeDefs += `
-            extend type OrderAddress {
-                customFields: JSON
-            }
+        if (schema.getType('OrderAddress')) {
+            customFieldTypeDefs += `
+                extend type OrderAddress {
+                    customFields: JSON
+                }
         `;
+        }
     }
 
     return extendSchema(schema, parse(customFieldTypeDefs));