Skip to content

Commit

Permalink
IsoDateTime always as string
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyslbw committed Jul 6, 2020
1 parent 1fd44da commit 53e3940
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
Expand Up @@ -6,7 +6,7 @@ Object {
"networkName": "mainnet",
"protocolConst": 2160,
"slotDuration": 20000,
"startTime": 2017-09-23T21:44:51.000Z,
"startTime": "2017-09-23T21:44:51.000Z",
},
}
`;
Expand Up @@ -75,10 +75,10 @@ Object {
"epochs": Array [
Object {
"blocksCount": "21589",
"lastBlockTime": 2017-10-03T21:43:51.000Z,
"lastBlockTime": "2017-10-03T21:43:51.000Z",
"number": 1,
"output": "101402912214214220",
"startedAt": 2017-09-28T21:45:51.000Z,
"startedAt": "2017-09-28T21:45:51.000Z",
"transactionsCount": "12870",
},
],
Expand All @@ -90,10 +90,10 @@ Object {
"epochs": Array [
Object {
"blocksCount": "21589",
"lastBlockTime": 2017-10-03T21:43:51.000Z,
"lastBlockTime": "2017-10-03T21:43:51.000Z",
"number": 1,
"output": "101402912214214220",
"startedAt": 2017-09-28T21:45:51.000Z,
"startedAt": "2017-09-28T21:45:51.000Z",
"transactionsCount": "12870",
},
],
Expand Down
@@ -1,8 +1,8 @@
export const epoch1 = {
basic: {
startedAt: new Date('2017-09-28T21:45:51.000Z'),
startedAt: '2017-09-28T21:45:51.000Z',
blocksCount: '21589',
lastBlockTime: new Date('2017-10-03T21:43:51.000Z'),
lastBlockTime: '2017-10-03T21:43:51.000Z',
output: '101402912214214220',
number: 1,
transactionsCount: '12870'
Expand Down
5 changes: 5 additions & 0 deletions packages/util-dev/src/e2e_client.ts
Expand Up @@ -9,6 +9,11 @@ export const createE2EClient = async () => {
cache: new InMemoryCache({
addTypename: false
}),
defaultOptions: {
query: {
fetchPolicy: 'network-only'
}
},
link: createHttpLink({
uri: process.env.CARDANO_GRAPHQL_URI || 'http://localhost:3100',
fetch
Expand Down
2 changes: 1 addition & 1 deletion packages/util/src/scalars/DateTimeUtcToIso.ts
Expand Up @@ -10,7 +10,7 @@ export const DateTimeUtcToIso = new GraphQLScalarType({
name: 'DateTime',
description: 'UTC DateTime to ISO RFC 3339',
serialize (value) {
return DateTimeResolver.serialize.call(this, `${value}Z`)
return DateTimeResolver.serialize.call(this, `${value}Z`).toISOString()
},
parseValue (value) {
// Trim .000Z
Expand Down

0 comments on commit 53e3940

Please sign in to comment.