0
我試圖用graphql mutation
創建一個對象列表,但一直不成功。我發現錯誤,請查看代碼片段並評論錯誤傳播的位置。如何使用石墨烯的突變方法從一系列的字典中提取數據?
注:我使用Graphene上瓶與Python 2.7
下面是一個例子有效載荷:
mutation UserMutation {
createUser(
phones: [
{
「number」: 「609-777-7777」,
「label」: 「home"
},
{
「number」: 「609-777-7778」,
「label」: 「mobile"
}
]
)
}
在架構,我有以下幾點:
class CreateUser(graphene.Mutation):
ok = graphene.Boolean()
...
phones = graphene.List(graphene.String()) # this is a list of string but what I need is a list of dicts!
嗨,Syrus,如何將手機保存到分貝。我使用文檔代碼,但數據庫不受影響 –