Skip to content

Commit

Permalink
Merge pull request #32 from smartcontractkit/fix-removal-of-timestamp…
Browse files Browse the repository at this point in the history
…s-for-node-and-chain

Fixes the GQL call to handle the removal of timestamps from Node and …
  • Loading branch information
jkongie authored Mar 23, 2023
2 parents 67c1a28 + 93aee13 commit d17e013
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .changeset/quick-days-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@smartcontractkit/operator-ui': patch
---

Fixes Node and Chain GQL queries which call the `CreatedAt` field which was removed
1 change: 0 additions & 1 deletion src/hooks/queries/useChainsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const CHAINS_PAYLOAD__RESULTS_FIELDS = gql`
fragment ChainsPayload_ResultsFields on Chain {
id
enabled
createdAt
}
`

Expand Down
1 change: 0 additions & 1 deletion src/screens/Node/NodeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const NODE_PAYLOAD_FIELDS = gql`
}
httpURL
wsURL
createdAt
state
sendOnly
}
Expand Down
1 change: 0 additions & 1 deletion src/screens/Nodes/NodesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const NODES_PAYLOAD__RESULTS_FIELDS = gql`
id
}
name
createdAt
state
sendOnly
}
Expand Down
9 changes: 0 additions & 9 deletions support/factories/gql/fetchChains.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
import isoDate, { MINUTE_MS } from 'test-helpers/isoDate'

// buildChains builds a chain for the FetchChains query.
export function buildChain(
overrides?: Partial<ChainsPayload_ResultsFields>,
): ChainsPayload_ResultsFields {
const minuteAgo = isoDate(Date.now() - MINUTE_MS)

return {
__typename: 'Chain',
id: '5',
enabled: true,
createdAt: minuteAgo,
...overrides,
}
}

// buildsChains builds a list of chains.
export function buildChains(): ReadonlyArray<ChainsPayload_ResultsFields> {
const minuteAgo = isoDate(Date.now() - MINUTE_MS)

return [
buildChain({
id: '5',
enabled: true,
createdAt: minuteAgo,
}),
buildChain({
id: '42',
enabled: true,
createdAt: minuteAgo,
}),
]
}
5 changes: 0 additions & 5 deletions support/factories/gql/fetchNode.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import isoDate, { MINUTE_MS } from 'test-helpers/isoDate'

// buildNodePayloadFields builds the node fields.
export function buildNodePayloadFields(
overrides?: Partial<NodePayload_Fields>,
): NodePayload_Fields {
const minuteAgo = isoDate(Date.now() - MINUTE_MS)

return {
__typename: 'Node',
id: '1',
name: 'node1',
httpURL: 'https://node1.com',
wsURL: 'wss://node1.com',
createdAt: minuteAgo,
chain: {
id: '42',
},
Expand Down
9 changes: 0 additions & 9 deletions support/factories/gql/fetchNodes.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import isoDate, { MINUTE_MS } from 'test-helpers/isoDate'

// buildNode builds a node for the FetchNodes query.
export function buildNode(
overrides?: Partial<NodesPayload_ResultsFields>,
): NodesPayload_ResultsFields {
const minuteAgo = isoDate(Date.now() - MINUTE_MS)

return {
__typename: 'Node',
id: '1',
name: 'node1',
chain: {
id: '42',
},
createdAt: minuteAgo,
state: '',
sendOnly: false,
...overrides,
Expand All @@ -22,24 +17,20 @@ export function buildNode(

// buildNodes builds a list of nodes.
export function buildNodes(): ReadonlyArray<NodesPayload_ResultsFields> {
const minuteAgo = isoDate(Date.now() - MINUTE_MS)

return [
buildNode({
id: '1',
name: 'node1',
chain: {
id: '42',
},
createdAt: minuteAgo,
}),
buildNode({
id: '2',
name: 'node2',
chain: {
id: '5',
},
createdAt: minuteAgo,
}),
]
}

0 comments on commit d17e013

Please sign in to comment.