When passing the parameters to the apollo subscription, it doesn’t work correctly
I subscribe 2 tokens
0x55d398326f99059ff775485246999027b3197955
0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c
network: bsc
But the data responded from the Bitquery server seems wrong, It returns tokens that I didn’t request as you can see the image below.
The query
export const SubscribeTradingDocument = gql`
subscription subscribeTrading($network: network!, $baseCurrency: String!, $quoteCurrency: String!) {
EVM(network: $network) {
buy: DEXTrades(
Trade: {Sell: {Currency: {SmartContract: {is: $baseCurrency}}}, Buy: {Currency: {SmartContract: {is: $quoteCurrency}}}}
) {
Block {
Time
}
Trade {
Sell {
Buyer
Amount {
Decimal
}
Currency {
Symbol
}
}
Buy {
Price
Amount {
Decimal
}
Currency {
Symbol
}
}
}
}
sell: DEXTrades(
Trade: {Buy: {Currency: {SmartContract: {is: $baseCurrency}}}, Sell: {Currency: {SmartContract: {is: $quoteCurrency}}}}
) {
Block {
Time
}
Trade {
Sell {
Price
Buyer
Amount {
Decimal
}
Currency {
Symbol
}
}
Buy {
Amount {
Decimal
}
Currency {
Symbol
}
}
}
}
}
}
`;
Calling subscription
const vars: SubscribeTradingSubscriptionVariables = useMemo(
() => ({
network: "bsc",
baseCurrency: "0x55d398326f99059ff775485246999027b3197955",
quoteCurrency: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
}),
[]
);
useSubscribeTradingSubscription({
onData: (data) => {
console.log("COMING", data.data.data?.EVM);
},
variables: {
...vars,
},
});
The request from chrome inspection
The response from chrome inspection

