Esempio n. 1
0
 class Query(slothql.Object):
     root = slothql.Field(A,
                          resolver=lambda: {'b': {
                              'a': {
                                  'field': 'foo'
                              }
                          }})
Esempio n. 2
0
 class Nested(slothql.Object):
     nested = slothql.Field(self.query_class(), resolver=lambda *_: None)
Esempio n. 3
0
 class Nested(slothql.Object):
     nested = slothql.Field(self.query_class() if call else self.query_class, lambda *_: {'world': 'not hello'})
Esempio n. 4
0
 class B(slothql.Object):
     a = slothql.Field(A)
     field = slothql.String()
Esempio n. 5
0
 class A(slothql.Object):
     b = slothql.Field(lambda: B)
     field = slothql.String()
Esempio n. 6
0
 class A(slothql.Object):
     a = slothql.Field(lambda: A)
     field = slothql.String()
Esempio n. 7
0
class Parent(Model):
    children = slothql.Field(Child, many=True)

    class Meta:
        model = RelationParent
        fields = '__all__'
Esempio n. 8
0
 class B(slothql.Object):
     a = slothql.Field(A)
Esempio n. 9
0
 class Query(slothql.Object):
     a1 = slothql.Field(A)
     a2 = slothql.Field(A)
Esempio n. 10
0
    class Query(slothql.Object):
        def get_b(self, obj, info):
            return {'a': {'field': 'resolved'}}

        b = slothql.Field(B, resolver=get_b)