Lokka如何在GraphQL中改变数组?

问题描述:

我的查询:imageList - object; 我无法理解如何通过变量进行变异;Lokka如何在GraphQL中改变数组?

let query = `query _($type: NoteTypeEnum!, $imageList: ???){ 
    addNote(note: { 
    imageList: [{ 
     fileName: $fileName, 
     url: $url, 
     uuid: $uuid 
    }] 
    }) {} 
}`; 

类型的列表是用方括号及其中的列表的类型定义的,所以你的情况我想这应该是:

let query = `query _($type: NoteTypeEnum!, $imageList: [Json]){ 
addNote(note: { 
imageList: [{ 
    fileName: $fileName, 
    url: $url, 
    uuid: $uuid 
}] 
}) {} 
}`;