Interfaces

GraphQL interfaces that define shared contracts across multiple types

Audience: Programmer

GraphQL interfaces are abstract types that define a set of fields that multiple object types can implement. They enable polymorphic queries and ensure consistent field definitions across related types.

Available Interfaces

Core Interfaces

Common Patterns

  • WithCustomData - Entities with JSON data fields

  • WithTenant - Multi-tenant capable entities

  • WithMovement - Entities that support movements

  • WithWorkflows - Workflow-enabled entities

  • Notifiable - Entities that can send notifications

  • Searchable - Full-text searchable entities

Usage

Interfaces enable you to write queries that work across multiple types:

Benefits

  1. Type Safety - Ensures consistent field definitions

  2. Polymorphism - Query multiple types with a single interface

  3. Code Reuse - Share common field definitions

  4. Extensibility - Easy to add new types that implement existing interfaces

See Also

Last updated

Was this helpful?