Skip to content

Conversation

22Yash
Copy link

@22Yash 22Yash commented Oct 10, 2025

Problem:
Users can create a circular dependency between custom types (e.g., Type A references Type B, and Type B references Type A). This structure is invalid and cannot be correctly generated in a schema but was not being flagged as an issue.

Furthermore, an initial attempt to implement this failed due to a case mismatch between how custom type names are defined (type_a) and how they are referenced by fields (TYPE_A).

Solution:

  1. Implemented Circular Dependency Check: Added a Depth First Search (DFS) algorithm within getIssues.js to detect cycles within the diagram.types graph.
  2. Added Translation Key: Included the new translation key circular_type_dependency in en.js.
  3. Fixed Casing Discrepancy (Name Normalization): Normalized all custom type names and references to uppercase within the DFS logic. This ensures the lookup works reliably regardless of the casing in the stored data, correctly identifying the circular reference.

Validation/Testing:
Created two custom types, type_A and type_B.

  • type_A has a field referencing TYPE_B.
  • type_B has a field referencing TYPE_A.

Expected Result (Achieved): The Issues panel now correctly displays "Issues (1)" and the message: "Circular type dependency detected in: type_A."
Screenshot 2025-10-10 144920

Copy link

vercel bot commented Oct 10, 2025

@22Yash is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant