有什么方法可以在 Apollo Studio 中格式化日期字段的渲染?

问题描述

使用 Apollo Studio 探索我公司的基于 GraphQL 的 API 很方便,但我想知道是否有任何方法可以让 Studio 格式化某些字段(或者也许可以在 GraphQL 中执行此操作):

query SomeQuery {
  searchOurThings(statuses:["somestatus"],categories:["somecategory"]) {
    edges {
      node {
        ... on OurThing {
          id
          description
          startTime     // <--- can I tell it to format this,from seconds to human-readable?
        }
      }
    }
  }
}

查询返回:

{
"data": {
    "searchOurThings": {
      "edges": [
        {
          "node": {
            "id": "<redacted>","description": null,"startTime": 1620853234000
          }
        },{
          "node": {
            "id": "<redacted>","startTime": 1620852304173
          }
        }
      ]
    }
  }
}

但我很想看看:

{
"data": {
    "searchOurThings": {
      "edges": [
        {
          "node": {
            "id": "<redacted>","startTime": "2021-05-12 12:34:56 -0700"
          }
        },"startTime": "2021-05-12 12:34:56 -0700"
          }
        }
      ]
    }
  }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)