profusion / sgqlc

Simple GraphQL Client
https://sgqlc.readthedocs.io/
ISC License
507 stars 83 forks source link

Node Cross Referencing #195

Open BimAdmin opened 2 years ago

BimAdmin commented 2 years ago

I've very recently implemented your module and am having some problems with Node cross refferencing (See snipet below). Any suggestions for this or is this fundimentaly impossible?

e.g.

class UserNode(Node):
    teams = list_of(TeamNode)

class TeamNode(Node);
    users = list_of(UserNode)

and

class ItemNode(Node):
    parentItem = ItemNode

Thanks!

barbieri commented 2 years ago

i suggest you generate this with the codegen, but you can have string for such things, see https://sgqlc.readthedocs.io/en/latest/sgqlc.types.html#cross-references-loops

barbieri commented 2 years ago

hi @BimAdmin, does that solve your problem?

innomatica commented 1 month ago

i suggest you generate this with the codegen, but you can have string for such things, see https://sgqlc.readthedocs.io/en/latest/sgqlc.types.html#cross-references-loops

I had the same issue and this worked.