Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli, common: update urql to 3.1.0
Browse files Browse the repository at this point in the history
dwerner committed Oct 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 2199080 commit b948991
Showing 6 changed files with 95 additions and 95 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -29,8 +29,8 @@
"sequelize": "6.33.0",
"@ethersproject/bignumber": "5.7.0",
"@ethersproject/providers": "5.7.0",
"@urql/core": "2.4.4",
"@urql/exchange-execute": "1.2.2",
"@urql/core": "3.1.0",
"@urql/exchange-execute": "2.1.0",
"punycode": "2.3.1",
"uri-js": "4.2.2"
},
@@ -39,8 +39,8 @@
"sequelize": "6.33.0",
"@ethersproject/bignumber": "5.7.0",
"@ethersproject/providers": "5.7.0",
"@urql/core": "2.4.4",
"@urql/exchange-execute": "1.2.2",
"@urql/core": "3.1.0",
"@urql/exchange-execute": "2.1.0",
"graphql": "16.8.0"
},
"engines": {
2 changes: 1 addition & 1 deletion packages/indexer-cli/package.json
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
"@graphprotocol/indexer-common": "^0.21.4",
"@iarna/toml": "2.2.5",
"@thi.ng/iterators": "5.1.74",
"@urql/core": "2.4.4",
"@urql/core": "3.1.0",
"chalk": "4.1.2",
"env-paths": "2.2.1",
"ethers": "5.7.0",
6 changes: 3 additions & 3 deletions packages/indexer-common/package.json
Original file line number Diff line number Diff line change
@@ -29,8 +29,8 @@
"@types/lodash.clonedeep": "^4.5.7",
"@types/lodash.intersection": "^4.4.7",
"@types/lodash.xor": "^4.5.7",
"@urql/core": "2.4.4",
"@urql/exchange-execute": "1.2.2",
"@urql/core": "3.1.0",
"@urql/exchange-execute": "2.1.0",
"axios": "1.6.2",
"body-parser": "1.20.2",
"cors": "2.8.5",
@@ -84,7 +84,7 @@
"ethers": "5.7.0",
"sequelize": "6.33.0",
"@ethersproject/bignumber": "5.7.0",
"@urql/exchange-execute/@urql/core": "2.4.4"
"@urql/exchange-execute/@urql/core": "3.1.0"
},
"babel": {
"presets": [],
38 changes: 23 additions & 15 deletions packages/indexer-common/src/graph-node.ts
Original file line number Diff line number Diff line change
@@ -154,15 +154,19 @@ export class GraphNode {
try {
this.logger.debug('Fetch subgraph deployment assignments')
const result = await this.status
.query(gql`
query indexingStatuses {
indexingStatuses {
subgraphDeployment: subgraph
node
paused
.query(
gql`
query indexingStatuses {
indexingStatuses {
subgraphDeployment: subgraph
node
paused
}
}
}
`)
`,
[],
[],
)
.toPromise()

if (result.error) {
@@ -213,14 +217,18 @@ export class GraphNode {
try {
this.logger.trace(`Querying indexing statuses`)
const result = await this.status
.query(gql`
{
indexingStatuses {
subgraphDeployment: subgraph
node
.query(
gql`
{
indexingStatuses {
subgraphDeployment: subgraph
node
}
}
}
`)
`,
[],
[],
)
.toPromise()

if (result.error) {
Original file line number Diff line number Diff line change
@@ -395,10 +395,9 @@ describe('Cost models', () => {
await client.mutation(SET_COST_MODEL_MUTATION, { costModel: input }).toPromise()
}

await expect(client.query(GET_COST_MODELS_QUERY).toPromise()).resolves.toHaveProperty(
'data.costModels',
inputs,
)
await expect(
client.query(GET_COST_MODELS_QUERY, [], []).toPromise(),
).resolves.toHaveProperty('data.costModels', inputs)
})

test('Get cost models with defined global models', async () => {
@@ -478,10 +477,9 @@ describe('Cost models', () => {

await client.mutation(SET_COST_MODEL_MUTATION, { costModel: input }).toPromise()

await expect(client.query(GET_COST_MODELS_QUERY).toPromise()).resolves.toHaveProperty(
'data.costModels',
[expected],
)
await expect(
client.query(GET_COST_MODELS_QUERY, [], []).toPromise(),
).resolves.toHaveProperty('data.costModels', [expected])
})

test('Delete one cost model', async () => {
@@ -597,10 +595,9 @@ describe('Feature: Inject $DAI variable', () => {
}
await client.mutation(SET_COST_MODEL_MUTATION, { costModel: update }).toPromise()

await expect(client.query(GET_COST_MODELS_QUERY).toPromise()).resolves.toHaveProperty(
'data.costModels',
[initial],
)
await expect(
client.query(GET_COST_MODELS_QUERY, [], []).toPromise(),
).resolves.toHaveProperty('data.costModels', [initial])
})

test('$DAI variable can be overwritten', async () => {
@@ -616,10 +613,9 @@ describe('Feature: Inject $DAI variable', () => {
variables: JSON.stringify({ DAI: '15.0' }),
}
await client.mutation(SET_COST_MODEL_MUTATION, { costModel: update }).toPromise()
await expect(client.query(GET_COST_MODELS_QUERY).toPromise()).resolves.toHaveProperty(
'data.costModels',
[update],
)
await expect(
client.query(GET_COST_MODELS_QUERY, [], []).toPromise(),
).resolves.toHaveProperty('data.costModels', [update])
})

test('$DAI updates are applied to all cost models', async () => {
@@ -642,21 +638,20 @@ describe('Feature: Inject $DAI variable', () => {

await client.setDai('15.3')

await expect(client.query(GET_COST_MODELS_QUERY).toPromise()).resolves.toHaveProperty(
'data.costModels',
[
{
...inputs[0],
// DAI was replaced here
variables: JSON.stringify({ n: 100, DAI: '15.3' }),
},
{
...inputs[1],
// DAI was added here
variables: JSON.stringify({ n: 10, DAI: '15.3' }),
},
],
)
await expect(
client.query(GET_COST_MODELS_QUERY, [], []).toPromise(),
).resolves.toHaveProperty('data.costModels', [
{
...inputs[0],
// DAI was replaced here
variables: JSON.stringify({ n: 100, DAI: '15.3' }),
},
{
...inputs[1],
// DAI was added here
variables: JSON.stringify({ n: 10, DAI: '15.3' }),
},
])
})

test('$DAI is added to new models', async () => {
@@ -681,21 +676,20 @@ describe('Feature: Inject $DAI variable', () => {
await client.mutation(SET_COST_MODEL_MUTATION, { costModel: input }).toPromise()
}

await expect(client.query(GET_COST_MODELS_QUERY).toPromise()).resolves.toHaveProperty(
'data.costModels',
[
{
...inputs[0],
// DAI was replaced here
variables: JSON.stringify({ n: 100, DAI: '15.3' }),
},
{
...inputs[1],
// DAI was added here
variables: JSON.stringify({ n: 10, DAI: '15.3' }),
},
],
)
await expect(
client.query(GET_COST_MODELS_QUERY, [], []).toPromise(),
).resolves.toHaveProperty('data.costModels', [
{
...inputs[0],
// DAI was replaced here
variables: JSON.stringify({ n: 100, DAI: '15.3' }),
},
{
...inputs[1],
// DAI was added here
variables: JSON.stringify({ n: 10, DAI: '15.3' }),
},
])
})

test('$DAI is preserved when cost model is updated', async () => {
@@ -712,15 +706,14 @@ describe('Feature: Inject $DAI variable', () => {
variables: null,
}
await client.mutation(SET_COST_MODEL_MUTATION, { costModel: update }).toPromise()
await expect(client.query(GET_COST_MODELS_QUERY).toPromise()).resolves.toHaveProperty(
'data.costModels',
[
{
...update,
variables: initial.variables,
},
],
)
await expect(
client.query(GET_COST_MODELS_QUERY, [], []).toPromise(),
).resolves.toHaveProperty('data.costModels', [
{
...update,
variables: initial.variables,
},
])
})

test('If feature is disabled, $DAI variable is not preserved', async () => {
@@ -749,7 +742,7 @@ describe('Feature: Inject $DAI variable', () => {
.mutation(SET_COST_MODEL_MUTATION, { costModel: update })
.toPromise()
await expect(
clientNoInjectDai.query(GET_COST_MODELS_QUERY).toPromise(),
clientNoInjectDai.query(GET_COST_MODELS_QUERY, [], []).toPromise(),
).resolves.toHaveProperty('data.costModels', [update])
})
})
31 changes: 15 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -3645,21 +3645,20 @@
resolved "https://registry.npmjs.org/@uniswap/v2-core/-/v2-core-1.0.1.tgz"
integrity sha512-MtybtkUPSyysqLY2U210NBDeCHX+ltHt3oADGdjqoThZaFRDKwM6k1Nb3F0A3hk5hwuQvytFWhrWHOEq6nVJ8Q==

"@urql/[email protected]", "@urql/core@>=2.3.6":
version "2.4.4"
resolved "https://registry.npmjs.org/@urql/core/-/core-2.4.4.tgz"
integrity sha512-TD+OS7jG1Ts6QkpU0TZ85i/vu40r71GF0QQFDhnWFtgkHcNwnpkIwWBMa72AR3j2imBTPpk61e/xb39uM/t37A==
"@urql/[email protected]", "@urql/core@3.1.0", "@urql/core@>=3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@urql/core/-/core-3.1.0.tgz#b77c6e444da35507b234645caed383cbb04d8ac9"
integrity sha512-6pYB4/WGZmuCxCc+h8AX9h+g1o75cPgMrcan+G/pYEDGAd6+PXoEuDumhEXpwu4vnkqCvVnFELEYcqkaM8ddPg==
dependencies:
"@graphql-typed-document-node/core" "^3.1.1"
wonka "^4.0.14"
wonka "^6.1.2"

"@urql/[email protected]":
version "1.2.2"
resolved "https://registry.npmjs.org/@urql/exchange-execute/-/exchange-execute-1.2.2.tgz"
integrity sha512-KebdnKWMKI1NkRtIxp8YIouynOaFnhcdaMNCcJEtp+kmY4vGZUgdxT/SIzTPXXYJvk5G2aiQ/JMr97I+wM/EHA==
"@urql/[email protected]", "@urql/[email protected]":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@urql/exchange-execute/-/exchange-execute-2.1.0.tgz#70058969248e204494526decf2bb75c11c965ad1"
integrity sha512-b84hq5EPgbERmg+98SqmMZqD5W3YrFkFii/6ZWVm5zsVdb+c0ZhRpUrpOCSemh5Jl5X291PG0WUUy2hdMtjraQ==
dependencies:
"@urql/core" ">=2.3.6"
wonka "^4.0.14"
"@urql/core" ">=3.1.0"
wonka "^6.0.0"

"@whatwg-node/events@^0.1.0":
version "0.1.1"
@@ -12650,10 +12649,10 @@ wkx@^0.5.0:
dependencies:
"@types/node" "*"

wonka@^4.0.14:
version "4.0.15"
resolved "https://registry.npmjs.org/wonka/-/wonka-4.0.15.tgz"
integrity sha512-U0IUQHKXXn6PFo9nqsHphVCE5m3IntqZNB9Jjn7EB1lrR7YTDY3YWgFvEvwniTzXSvOH/XMzAZaIfJF/LvHYXg==
wonka@^6.0.0, wonka@^6.1.2:
version "6.3.4"
resolved "https://registry.yarnpkg.com/wonka/-/wonka-6.3.4.tgz#76eb9316e3d67d7febf4945202b5bdb2db534594"
integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg==

word-wrap@^1.2.5, word-wrap@~1.2.3:
version "1.2.5"

0 comments on commit b948991

Please sign in to comment.