class Query(slothql.Object): root = slothql.Field(A, resolver=lambda: {'b': { 'a': { 'field': 'foo' } }})
class Nested(slothql.Object): nested = slothql.Field(self.query_class(), resolver=lambda *_: None)
class Nested(slothql.Object): nested = slothql.Field(self.query_class() if call else self.query_class, lambda *_: {'world': 'not hello'})
class B(slothql.Object): a = slothql.Field(A) field = slothql.String()
class A(slothql.Object): b = slothql.Field(lambda: B) field = slothql.String()
class A(slothql.Object): a = slothql.Field(lambda: A) field = slothql.String()
class Parent(Model): children = slothql.Field(Child, many=True) class Meta: model = RelationParent fields = '__all__'
class B(slothql.Object): a = slothql.Field(A)
class Query(slothql.Object): a1 = slothql.Field(A) a2 = slothql.Field(A)
class Query(slothql.Object): def get_b(self, obj, info): return {'a': {'field': 'resolved'}} b = slothql.Field(B, resolver=get_b)