Graphene对Field的一些基本操作

class type1(graphene.InputObjectType):
    name = graphene.String()
    gender= graphene.String()

class type2(graphene.ObjectType):
    name = graphene.String()
    gender= graphene.String()


class Query(graphene.ObjectType):
    users = graphene.List(UserType)
    user1 = graphene.String()
    users2 = graphene.Field(type2)
    users3 = graphene.Field(type2, a=type1())
    users4 = graphene.String(a=graphene.Argument(graphene.String))

 

 

 

posted @ 2020-07-10 00:36  青花メ  阅读(196)  评论(0编辑  收藏  举报