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

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

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