我有一个看起来像这样的突变
class ApisInteractiveGlobal(BaseMutation):
success = Boolean()
error = String()
class Arguments:
user_id = List(ID)
api_name = String()
global_apis = Boolean()
my_org_api = Boolean()
def mutate(self, info, user_id=[], api_name=None, global_apis=None, my_org_api=None):
for id in user_id:
user = User.objects.get(id=id)
api = user.apis_interactive.get(name=api_name)
if my_org_api is not None:
api.my_orgapis = my_org_api
if global_apis is not None:
api.global_apis = global_apis
api.save(update_fields=['global_apis', 'my_orgapis'])
return ApisInteractiveGlobal(success=True)
在这里,我试图一次传递一个用户列表来更新我的代码中的一些值。但是突变会引发错误。有人可以建议突变的列表输入为例吗?