Skip to content

Split GraphQL root merged groups to avoid query-depth overflow (issue #801)#802

Merged
sehkone merged 1 commit intomainfrom
octoaide/issue-801-2026-03-07T23-35-18
Mar 10, 2026
Merged

Split GraphQL root merged groups to avoid query-depth overflow (issue #801)#802
sehkone merged 1 commit intomainfrom
octoaide/issue-801-2026-03-07T23-35-18

Conversation

@octoaide
Copy link
Copy Markdown
Contributor

@octoaide octoaide Bot commented Mar 8, 2026

Background

This PR refactors the shape of the GraphQL root objects to reduce rustc query-depth pressure that can cause "queries overflow the depth limit" build failures on Rust 1.94+. The overflow is reproducible in our build/test on 1.94+ and is likely caused by recent layout-path changes that add an extra wrapping layer (e.g. ManuallyDrop -> MaybeDangling) which increases type-layout query depth in large merged GraphQL root types.

What changed

  • Reorganized the merged GraphQL root groups in src/graphql.rs by splitting each large MergedObject group into two smaller groups (A/B). The root tuple types were updated from 2-tuples to 4-tuples:
    • Query now: pub(super) struct Query(SubQueryOneA, SubQueryOneB, SubQueryTwoA, SubQueryTwoB);
    • Mutation now: pub(super) struct Mutation(SubMutationOneA, SubMutationOneB, SubMutationTwoA, SubMutationTwoB);
  • The split reduces the number of merged types per subgroup (roughly halving them) to decrease type-layout/query-depth complexity while preserving the schema and API behavior.
  • Only internal organization was changed; no GraphQL schema or public API behavior was modified.

Files changed

  • src/graphql.rs — split the original SubQuery*/SubMutation* groups into A/B subgroups and updated the root structs
  • CHANGELOG.md — note about internal refactor (minor)

Why this fixes the issue

Splitting large merged groups reduces the depth of type-layout queries produced by the derive/merge machinery for complex async/type-heavy GraphQL root types. This lowers the probability of hitting rustc's query-depth limit, especially on Rust 1.94+ where layout paths increased in depth.

Verification

  • cargo test --no-default-features --features auth-jwt — 152 passed
  • cargo test --no-default-features --features auth-mtls — 103 passed (92 unit + 11 integration)
  • cargo clippy — 0 warnings for both feature flags

Notes

  • This is an internal refactor only; no behavior or schema changes were introduced.
  • We intentionally avoided adding a crate-level recursion_limit attribute as the primary fix.

References

Closes #801

@octoaide octoaide Bot requested a review from kimhanbeom March 8, 2026 17:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.33%. Comparing base (f853945) to head (2f4e7f3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #802   +/-   ##
=======================================
  Coverage   76.33%   76.33%           
=======================================
  Files          73       73           
  Lines       20293    20293           
=======================================
  Hits        15490    15490           
  Misses       4803     4803           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Mitigate rustc query-depth overflow on Rust 1.94+ by splitting
large Query/Mutation MergedObject groups. Preserve existing
GraphQL schema and response behavior.
@kimhanbeom kimhanbeom force-pushed the octoaide/issue-801-2026-03-07T23-35-18 branch from a3c2626 to 2f4e7f3 Compare March 9, 2026 02:08
@kimhanbeom kimhanbeom requested a review from sophie-cluml March 9, 2026 04:00
@sehkone sehkone merged commit a6cc39c into main Mar 10, 2026
18 checks passed
@sehkone sehkone deleted the octoaide/issue-801-2026-03-07T23-35-18 branch March 10, 2026 04:12
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.

Refactor GraphQL root MergedObject groups to reduce rustc query-depth overflow on Rust 1.94+

3 participants