Django graphene - 无需打字的突变输入

Django graphene - mutation input without typing

在突变中,我只需要保存事件名称及其可能不同的负载,我不需要对其进行任何验证。我怎么能说石墨烯我只需要接受一个物体?

class SendEvent(MutationMixin, relay.ClientIDMutation):
    class Input:
        event = graphene.String(required=True)
        payload = # any object

希望大家可以使用GenericScalar(...)

from graphene.types.generic import GenericScalar


class SendEvent(MutationMixin, relay.ClientIDMutation):
    class Input:
        event = graphene.String(required=True)
        payload = <b>GenericScalar(required=True)</b>