Skip to content

Conversation

@kettanaito
Copy link
Member

@kettanaito kettanaito commented Oct 16, 2025

Changes

  • No longer sanitizes records during create/update to prevent infinite loops on circular objects (relations).

Motivation

The record sanitization we have is a workaround to help schema libraries parse circular objects. Ultimately, this isn't something Data should be doing. I see no reason schema libraries shouldn't support circular objects.

Todos

  • Either land circular object support in Zod (Support circular object validation colinhacks/zod#5346) or find a schema library that supports it and migrate the tests to it to have them passing.
  • Copy over the internal symbols as they aren't enumerable so schema validation libraries strip them, causing Error: Failed to store foreign record reference for "country" relation: the referenced record ({"code":"us"}) is missing the primary key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants