@snteam/amplify-angular-core 1.0.43 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2546,6 +2546,11 @@ class AmplifyModelService {
|
|
|
2546
2546
|
// Final fallback - use a simple, predictable selection set
|
|
2547
2547
|
const fallbackSelectionSet = this.generateSimpleFallbackSelectionSet(config);
|
|
2548
2548
|
console.log('AmplifyModelService: Using simple fallback selection set:', fallbackSelectionSet);
|
|
2549
|
+
// Ensure we never return an empty array
|
|
2550
|
+
if (fallbackSelectionSet.length === 0) {
|
|
2551
|
+
console.warn('AmplifyModelService: Fallback selection set is empty, using minimal default');
|
|
2552
|
+
return ['id'];
|
|
2553
|
+
}
|
|
2549
2554
|
return fallbackSelectionSet;
|
|
2550
2555
|
}
|
|
2551
2556
|
catch (error) {
|
|
@@ -2587,13 +2592,15 @@ class AmplifyModelService {
|
|
|
2587
2592
|
generateSimpleFallbackSelectionSet(config) {
|
|
2588
2593
|
const selectionSet = ['id'];
|
|
2589
2594
|
if (config.fieldName) {
|
|
2590
|
-
// Add the relationship field itself
|
|
2595
|
+
// Add the relationship field itself with basic nested fields
|
|
2591
2596
|
selectionSet.push(config.fieldName);
|
|
2592
|
-
// Add common nested fields
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2597
|
+
// Add common nested fields that are likely to exist
|
|
2598
|
+
const commonFields = ['id', 'name', 'title', 'label', 'description'];
|
|
2599
|
+
for (const field of commonFields) {
|
|
2600
|
+
selectionSet.push(`${config.fieldName}.${field}`);
|
|
2601
|
+
}
|
|
2596
2602
|
}
|
|
2603
|
+
console.log('AmplifyModelService: Generated simple fallback selection set:', selectionSet);
|
|
2597
2604
|
return selectionSet;
|
|
2598
2605
|
}
|
|
2599
2606
|
setRelatedSub(config, baseId) {
|