[Bug] The order data source under sources tab in .graphclientrc.yml affects the query result
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- graphql, typescript
- Ambito
- api
Direzione di ricerca
Start with the source ordering in .graphclientrc.yml and the aliased live queries in operations.gql, then run npx ts-node .\src\demo_live_query.ts using both source orders. Trace the generated client and pollingLive behavior to identify why the Ethereum query becomes empty; done means the same query returns the same data regardless of source order.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I found the order of .graphclientrc.yml affects the query result. Here is the steps to reproduce:
.graphclientrc.yml
sources:
- name: uniswapv3_arbitrum
handler:
graphql:
endpoint: https://gateway-arbitrum.network.thegraph.com/api/[your api key]/subgraphs/id/HyW7A86UEdYVt5b9Lrw8W2F98yKecerHKutZTRbSCX27
- name: uniswapv3_ethereum
handler:
graphql:
endpoint: https://gateway.thegraph.com/api/[your api key]/subgraphs/id/5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV
plugins:
- pollingLive:
defaultInterval: 10000
documents:
- operations.gql
operations.gql:
fragment PoolLiveDataFields on Pool {
liquidity
tick
sqrtPrice
feeTier
id
}
query GetMultipleEthereumPoolLiveData($poolIds: [ID!]!) @live(interval: 5000) {
uniswapv3_ethereum: pools(where: { id_in: $poolIds }) {
...PoolLiveDataFields
}
}
query GetMultipleArbitrumPoolLiveData($poolIds: [ID!]!) @live(interval: 5000) {
uniswapv3_arbitrum: pools(where: { id_in: $poolIds }) {
...PoolLiveDataFields
}
}
demo_live_query.ts, client codes:
import {getBuiltGraphSDK} from '../.graphclient'
async function main() {
const sdk = getBuiltGraphSDK()
// chainId=1
const poolIds_ethereum = ["0xe0554a476a092703abdb3ef35c80e0d76d32939f",
"0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8",
"0x7bea39867e4169dbe237d55c8242a8f2fcdcc387",
"0x493035412520336ff4719d4cee527bea55eca844",
"0xdceaf5d0e5e0db9596a47c0c4120654e80b1d706"]
// start to monitor pools on Ethereum
const ethereumStream = await sdk.GetMultipleEthereumPoolLiveData({ poolIds: poolIds_ethereum });
(async () => {
for await (const result of ethereumStream) {
console.log('[Ethereum]', result.uniswapv3_ethereum);
}
})().catch(console.error);
}
main()
run
npx ts-node .\src\demo_live_query.ts
Everything works well.
But when I the order of uniswapv3_arbitrum and uniswapv3_ethereum in .graphclientrc.yml, I get an empty result when ruuning the same client codes
This is the content of .graphclientrc.yml after changing the order:
sources:
- name: uniswapv3_ethereum
handler:
graphql:
endpoint: https://gateway.thegraph.com/api/eada99c8eee80663db1e909b89c14a3f/subgraphs/id/5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV
- name: uniswapv3_arbitrum
handler:
graphql:
endpoint: https://gateway-arbitrum.network.thegraph.com/api/eada99c8eee80663db1e909b89c14a3f/subgraphs/id/HyW7A86UEdYVt5b9Lrw8W2F98yKecerHKutZTRbSCX27
plugins:
- pollingLive:
defaultInterval: 10000
documents:
- operations.gql
- Lingua principale
- TypeScript
- Stelle
- 185
- Fork
- 49
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di graphprotocol/graph-client
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
graphprotocol/graph-client#1029 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
graphprotocol/graph-client#1031 · 4 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 50/100
graphprotocol/graph-client#991 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 28/100
graphprotocol/graph-client#957 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
graphprotocol/graph-client#940 · 6 commenti · 1 reazione ·
Tutte le issue di graphprotocol/graph-client
Issue simili
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memoryForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 82/100
awslabs/visual-asset-management-system#413 ·
I maintainer di solito rispondono entro 1 giorno
-
bug confirmed perf
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
videojs/video.js#9400 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug pending triage scope/agent
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue hacktoberfest
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
HelpCode-ai/anythingmcp#996 ·
I maintainer di solito rispondono entro 1 giorno