如何在graphql-yoga中获得响应的状态码?

时间:2019-07-31 17:55:47

标签: graphql graphql-js express-graphql

我将graphql-yoga用于我的graphql服务器,我想在var poDetails = new List<PurchaseOrderDetail>(); foreach (var po in purchaseOrders) { var poDetail = await PurchaseOrderDetails.PullAsync(queryName, PurchaseOrderDetailsTable.CreateQuery().Where(pod => po.Id == pod.PoId); poDetails.Add(poDetail); } 下提取状态代码:

formatResponse
  Query: {
    get_foo: () => {
      return fetch(URL).then(res => res.json());
    },
const options = {
  ...
  // A function applied to each response after execution
  formatResponse,
};

我尝试同时打印两个const formatResponse = (res) => { console.log(res); }; ,但响应(res, req)没有存储状态码字段。

0 个答案:

没有答案