Any way to format a date field's rendering in Apollo Studio?

331 views Asked by At

Using Apollo Studio to explore my company’s GraphQL-based API is handy, but I was wondering if there was any way to have the Studio format certain fields (or maybe it's something one can do in 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?
        }
      }
    }
  }
}

That query returns this:

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

But I'd love to see:

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

There are 0 answers