Enhanced Foreign Key Behavior
I am reaching out to share a suggestion regarding the current implementation of foreign key constraints in Firebase DataConnect.
Currently, it appears that the default behavior for foreign keys is automatically assigned during schema deployment, and there is no way to explicitly define ON DELETE and ON UPDATE rules (e.g., NO ACTION, CASCADE) in the GraphQL schema. This limitation has the following implications:
1. Deployment Overrides: Even if these rules are manually adjusted in the underlying PostgreSQL database, deploying an updated schema resets the rules to the platform’s defaults.
2. Lack of Customization in Schema: Adding support for directives like @relation(onDelete: NO_ACTION, onUpdate: CASCADE) would provide better control over foreign key behavior directly from the schema.