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

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

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

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