nikitastupin / clairvoyance

Obtain GraphQL API schema even if the introspection is disabled
Apache License 2.0
967 stars 87 forks source link

Infinite Loop When TypeRef References Parent TypeRef #49

Closed seanmarpo closed 1 year ago

seanmarpo commented 1 year ago

Clairvoyance cannot handle when a schema typeref back-references a typeref. The tool ends up stuck in an infinite loop and never progresses.

The tool gets caught in get_path_from_root() in graphql.py where there is a while loop that never completes. I ended up monkey-patching the oracle.py to avoid specific TypeName's that have this back reference.

Attached is a screenshot of a schema which does this. I had to kill the tool and the resulting schema showed the issue when thrown into a visualizer.

Screen Shot 2022-08-17 at 11 24 53 PM
nikitastupin commented 1 year ago

Hey @seanmarpo,

Thank you for reporting the issue and the detailed report! We'll try to solve this systematically once we have time.

Also, feel free to submit a pull request if you have the solution in mind 😃