【发布时间】:2021-02-26 12:17:04
【问题描述】:
我有一个问题。我正在使用 apollo -GraphQL,但我遇到了似乎无法正确解决的问题。所以我有这样的类型:
Price {
PriceBefore {
value
}
PriceAfter {
value
}
PriceSave {
value
}
}
我有 index.ts:
PriceBefore: async (data: SomeData, source: any, { dataSources }: any, context: any) => {
return someCalculation:
}
PriceAfter : async (data: SomeData, source: any, { dataSources }: any, context: any) => {
return someCalculation:
}
PriceSave : async (data: SomeData, source: any, { dataSources }: any, context: any) => {
return someCalculation:
}
我的问题是我不知道如何等待 PriceAfter 到 PriceBefore 完成,以及如何将结果从 PriceBefore 转移到 PriceAfter。与 PriceSave 相同,他们应该等待 PriceBefore 和 Price After 结束并从中获取数据。
有人知道吗?
提前致谢
【问题讨论】:
标签: typescript apollo