1 year ago
#102458
Shubhanshu Chauhan
Invalid or incomplete introspection result
When I am trying to run the below subscription code I am getting the error:
TypeError: Invalid or incomplete introspection result. Ensure that you are > passing the 'data' attribute of an introspection response and no 'errors' > were returned alongside: None.
What can I do to correct this?
from operator import concat
from gql import Client, gql
from gql.transport.aiohttp import AIOHTTPTransport
from graphql import get_introspection_query
import pandas as pd
from gql.transport.websockets import WebsocketsTransport
# Select your transport with a defined url endpoint
count =0
transport = WebsocketsTransport(url='wss://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2')
# Create a GraphQL client using the defined transport
client = Client(
transport=transport,
fetch_schema_from_transport=True
)
# Provide a GraphQL query
lastID=""
query = gql(
"""
subscription swaps{
swaps(orderBy: timestamp, orderDirection: desc) {
id
timestamp
amount0In
amount1In
amount0Out
amount1Out
pair {
token0 {
id
symbol
}
token1 {
id
symbol
}
}
}
}
"""
)
for result in client.subscribe(query):
print (result)
python-3.x
graphql
python-3.8
uniswap
thegraph
0 Answers
Your Answer