数据结构为:
fileName: {filterType: "text", type: "contains", filter: "a"}
如果数据结构如下:
0: {colId: "callDateTime", sort: "asc"}
我在c#中得到了这样的信息:
var sortings = ctx.GetArgument<List<SortModel>>("sorting");
我正在使用带有ag-grid和.net core 2.2的graphQl
消息错误:
变量'$ filterModel [0]'无效。无法将输入解析为 “ FilterModel”类型。您是否提供了列表或标量值 不小心?
在graphQL中查询(Angular 7):
const query = (request, columns) => {
console.log(request);
const fields = columns.map(col => col.field);
console.log(request.filterModel);
console.log(request.sortModel);
return {
query: gql`
query GetRows(
$start: Int,
$end: Int,
$sortModel: [SortModel],
$groups: [RowGroup],
$values: [Value],
$groupKeys: [String],
$filterModel: [FilterModel]
) {
rows(
startRow: $start,
endRow: $end,
sorting: $sortModel,
rowGroups: $groups,
values: $values,
groupKeys: $groupKeys,
filterModel: $filterModel
) {
${fields}
}
}`,
variables: {
start: request.startRow,
end: request.endRow,
sortModel: request.sortModel,
groups: request.rowGroupCols,
values: request.valueCols,
groupKeys: request.groupKeys,
filterModel: request.filterModel
},
}
我尝试过类似的操作:
var filterModel = ctx.GetArgument<IDictionary<string, FilterModel>>("filterModel");