mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 20:00:29 +01:00
[PR #233] [CLOSED] Fix infinite recursion in GraphQL docs explorer when handling circular type references #158
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mountain-loop/yaak/pull/233
Author: @jonasnobile
Created: 7/7/2025
Status: ❌ Closed
Base:
master← Head:fix/infinite-recursion-in-docs-explorer📝 Commits (1)
8b7d74cfix: infinite recursion in type graph traversal📊 Changes
1 file changed (+11 additions, -1 deletions)
View changed files
📝
src-web/components/GraphQLDocsExplorer.tsx(+11 -1)📄 Description
Problem
The GraphQL docs explorer was throwing "Maximum call stack size exceeded" errors due to infinite recursion when processing GraphQL schemas with circular type references.
Root Cause
The
getFieldsIndicesandgetTypeIndicesfunctions were calling each other recursively without checking for already-processed types:getFieldsIndicesprocesses fields and callsgetTypeIndicesfor each field's typegetTypeIndicesprocesses types and callsgetFieldsIndicesfor the type's fieldsSolution
Added a visited set to track which types have been processed:
visitedTypes: Set<string>toIndexGenerationContext🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.