kh0r / postgraphile-wrap-resolver-reproduce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

postgraphile-wrap-resolver-reproduce

Start with

npm run watch

go to localhost:3000/graphiql

Insert a testobj

mutation{
  createTest(input:{test:{}}) {
    test{
      updatedAt
      now
    }
  }
}

Query the testobjects

{
  allTests {
    nodes {
      updatedAt
      now
    }
  }
}

The returned data should return the same timestamps, but returns the "old" one for updatedAt:

{
  "data": {
    "allTests": {
      "nodes": [
        {
          "updatedAt": "2021-03-06T20:38:53.667086+00:00",
          "now": "2021-03-06T20:49:57.266Z"
        }
      ]
    }
  }
}

Running it a second time returns the timestamp inserted from the previous request for updatedAt:

{
  "data": {
    "allTests": {
      "nodes": [
        {
          "updatedAt": "2021-03-06T20:49:57.262678+00:00",
          "now": "2021-03-06T20:50:48.231Z"
        }
      ]
    }
  }
}

About


Languages

Language:JavaScript 100.0%