Hello this is my first time using bitquery and I was having some errors with my request function. Sorry I know this is probably a very trivial error if any one can spot it that would be much appreciated. When I run the python code I get this response {“data”:null,“errors”:[{“message”:“Cannot query field "Solana" on type "RootQuery".”,“locations”:[{“line”:3,“column”:9}]}]}
how can I get it to properly return the top coins on pump fun on solana ?
import requests
import json
def request():
access_token = 'myRealApiKeyHere'
# Step 2: Make Streaming API query
url_graphql = "https://streaming.bitquery.io/graphql"
headers_graphql = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
graphql_query = '''
{
Solana {
DEXTrades(
limitBy: {
by: Trade_Buy_Currency_MintAddress
count: 1
}
orderBy: { descending: Trade_Buy_Price }
where: {
Trade: { Dex: { ProtocolName: { is: "pump" } } }
Buy: {
Currency: {
MintAddress: {
notIn: ["11111111111111111111111111111111"]
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Trade {
Buy {
Price
PriceInUSD
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
}
}
}
}
'''
payload_graphql = json.dumps({'query': graphql_query})
# Step 3: Make request to Streaming API
response_graphql = requests.post(url_graphql, headers=headers_graphql, data=payload_graphql)
# Print the response
print(response_graphql.text)
request()