Python graphene 模块,InputObjectType() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用graphene.InputObjectType()

项目:graphene-django    作者:graphql-python    | 项目源码 | 文件源码
def convert_serializer_to_input_type(serializer_class):
    serializer = serializer_class()

    items = {
        name: convert_serializer_field(field)
        for name, field in serializer.fields.items()
    }

    return type(
        '{}Input'.format(serializer.__class__.__name__),
        (graphene.InputObjectType,),
        items
    )