Skip to content

Commit

Permalink
请求GraphQL接口时算出来返回字段模板写到作用域data内,以便在自定义发送适配器中可以拿到,而不用重新计算
Browse files Browse the repository at this point in the history
  • Loading branch information
yinlianghui committed Mar 29, 2024
1 parent 7cb6a62 commit 9fe6cfa
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,15 @@ export async function getFindQuery(object, recordId, fields, options){
// return item.replace(/^{/,"").replace(/}$/,"");
// }).join(",")) : "";

const fieldsTemplate = `${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}`;

return {
orderBy: "${orderBy}",
orderDir: "${orderDir}",
pageNo: "${page}",
pageSize: "${perPage}",
query: `{${alias}:${object.name}${queryOptions}{${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}}${countQuery}}`
queryFields: fieldsTemplate,
query: `{${alias}:${object.name}${queryOptions}{${fieldsTemplate}}${countQuery}}`
}
}

Expand Down

0 comments on commit 9fe6cfa

Please sign in to comment.