experiment: allow Any type outputs to always pass connection validation

This commit is contained in:
psychedelicious
2025-03-08 09:06:40 +10:00
parent a32f3be4f1
commit 1730a0cd41

View File

@@ -58,6 +58,7 @@ export const validateConnectionTypes = (sourceType: FieldType, targetType: Field
const isSubTypeMatch = doesCardinalityMatch && (isIntToFloat || isIntToString || isFloatToString);
const isTargetAnyType = targetType.name === 'AnyField';
const isSourceAnyType = sourceType.name === 'AnyField';
// One of these must be true for the connection to be valid
return (
@@ -67,6 +68,7 @@ export const validateConnectionTypes = (sourceType: FieldType, targetType: Field
isGenericCollectionToAnyCollectionOrSingleOrCollection ||
isCollectionToGenericCollection ||
isSubTypeMatch ||
isTargetAnyType
isTargetAnyType ||
isSourceAnyType
);
};