How restrict a constraints to a content type? I would like to create validation for a several fields on a content type to check if they each have unique values from each other. The part I'm struggling with is how to add the constraint for just my content type, and not all node entities. So far I'm using hook_entity_type_build() to add: $entity_types['node']-&gt;addConstraint('UniqueSizes', []); Is there a way to restrict this to only my content type?
No, it's not directly possibly when adding the constraint.

But you can always check the bundle or existence of certain fields (in some places preferable, if you ever need another node type with those fields and the same logic) within your constraint when it is run.