Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to Consume Depth Only on @model Joins, Allow Infinite Non-@model Nesting #943

Open
2 tasks
jgroom33 opened this issue Feb 24, 2025 · 0 comments
Open
2 tasks
Labels
amplify-codegen Issues on amplify-codegen feature-request New feature or request

Comments

@jgroom33
Copy link

jgroom33 commented Feb 24, 2025

Describe the feature you'd like to request

Problem
The current amplify-codegen depth logic (--maxDepth) increments depth for every nesting level, including into non-@model types (embedded objects/lists within a table). This limits traversal into a single table’s embedded structures, treating them as equivalent to joins, when only @model relationships (table-to-table joins) should consume depth.

Describe the solution you'd like

Add an option to redefine depth so:

  1. Depth Consumes Only on @model Joins: Nesting into non-@model types doesn’t increment depth.
  2. Infinite Non-@model Depth: Fully expand embedded types without depth limits, respecting cycles.

Benefits

  1. Logical Complexity: Depth reflects table joins (e.g., Todo to User @model), not embedded structure within a table, matching Amplify’s single-table design model.
  2. Full Embedded Exposure: Infinite depth for non-@model types allows complete traversal of a table’s embedded data.

Proposed Implementation
New Config Option: depthByModelOnly: true (default false)—Depth increments only for @model joins, preserving current behavior unless opted in.

Describe alternatives you've considered

None

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@jgroom33 jgroom33 added the pending-triage Issues that need further discussion to determine label Feb 24, 2025
@AnilMaktala AnilMaktala added feature-request New feature or request amplify-codegen Issues on amplify-codegen and removed pending-triage Issues that need further discussion to determine labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amplify-codegen Issues on amplify-codegen feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants