Relation selector components provide a powerful way to select related entities in your dashboard forms. They support both single and multi-selection modes with built-in search, infinite scroll pagination, and complete TypeScript type safety.
The relation selector system consists of three main components:
RelationSelector: The abstract base component that handles all core functionalitySingleRelationInput: Convenient wrapper for single entity selectionMultiRelationInput: Convenient wrapper for multiple entity selectionThe createRelationSelectorConfig function accepts these options:
The label prop allows you to customize how items are displayed in both the dropdown and selected item chips. This enables rich content like images, badges, and multi-line information.
Register your relation selector components in your dashboard extension:
The relation selector package includes pre-configured setups for common Vendure entities:
Leverage TypeScript generics for full type safety:
When using the label prop for custom rendering:
1. "Cannot query field X on type Query"
Error: Cannot query field "myEntities" on type "Query"
Solution: Ensure your GraphQL query field name matches your schema definition exactly.
2. Empty results despite data existing
3. TypeScript errors with config
If you experience slow loading:
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team