Exemple #1
0
 class Query(slothql.Object):
     hello = slothql.String(resolver=resolver)
Exemple #2
0
 class B(slothql.Object):
     a = slothql.Field(A)
     field = slothql.String()
Exemple #3
0
 class Query(slothql.Object):
     hello = slothql.String(resolver=lambda *_: 'world')
Exemple #4
0
 class A(slothql.Object):
     a = slothql.Field(lambda: A)
     field = slothql.String()
Exemple #5
0
 class A(slothql.Object):
     b = slothql.Field(lambda: B)
     field = slothql.String()
Exemple #6
0
    class Test(Object):
        def get_field(self, obj):
            return obj

        field = slothql.String(resolver=get_field)
Exemple #7
0
    class Test(Object):
        @classmethod
        def get_field(cls, obj):
            return obj

        field = slothql.String(resolver=get_field)
Exemple #8
0
    class Test(Object):
        @staticmethod
        def get_field(obj):
            return obj

        field = slothql.String(resolver=get_field)
Exemple #9
0
 class Test(Object):
     field = slothql.String(resolver=lambda obj: obj)
 class A(slothql.Object):
     field = slothql.String()