Circular dependency issue when using functional syntax #1449
Labels
Community 👨👧
Something initiated by a community
Need More Info 🤷♂️
Further information is requested
Question ❔
Not future request, proposal or bug issue
Describe the Bug
A ReferenceError is thrown at startup due to circular references. These circular references occur while using the
@Field(type => SomeType)
syntax.To Reproduce
Example Repository: https://github.com/zacharyclaysmith/type-graphql-circular-dependency-repro
(Key code extracts in Additional Context below)
Expected Behavior
The "functional syntax" should keep this kind of issue from happening:
From https://typegraphql.com/docs/0.17.1/types-and-fields.html:
Logs
If applicable, add some console logs to help explain your problem.
You can paste the errors with stack trace that were printed when the error occurred.
Environment (please complete the following information):
Additional Context
This example was recreated from a larger project where I'm running into this issue. I tried to remove any unnecessary cruft when copying over pieces of code/dependency lists.
The original project also uses mikro-orm, and I avoid circular dependencies with their library due to the ability to use a string version of the type name, e.g.
@Property('User')
.Key Code extracts:
The text was updated successfully, but these errors were encountered: