'Django / GraphQL -- 2 types have fields that are referencing each other causes a crash

I have 2 graphql types that each have fields that refer to the other. There is an error because one of the types has not been declared when the first one is read. The issue is that the type should be instantiated before using it in a field. But since the two types refer to each other, One is always being referred to before it has been instantiated.

Any ideas on how to solve?

Here is a link to the parts of the code that are relevant: https://gist.github.com/olivermontalbano/ce8db9fd62619b983ed68b6933ff7e64



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source