You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importjsonimportrequestsdefrun_query():
q=""" { moloches { id totalShares totalLoot } } """# The Graph DAOhaus xDAI endpointresponse=requests.post(
'https://api.thegraph.com/subgraphs/name/odyssy-automaton/daohaus-xdai',
'',
json={"query": q}
)
ifresponse.status_code==200:
result=response.textdaos= []
# put each moloch record into a listfordaoinjson.loads(result)['data']['moloches']:
data=dict()
data["dao_hash"] =dao["id"]
daos.append(dao)
# return count of moloch records added to listreturnprint(len(daos))
else:
raiseException("Query failed. Return code is {}. {}".format(response.status_code, q))
if__name__=="__main__":
run_query()
This short example returns 100 records. There are far more DAOs than that on the xDAI network I assume if correct - how does the API handle pagination?
The text was updated successfully, but these errors were encountered:
I'm using the Daohaus Xdai API (https://api.thegraph.com/subgraphs/name/odyssy-automaton/daohaus-xdai) to create a dataset of DAOs. What I want to know is how to deal with pagination and get all records?
This short example returns 100 records. There are far more DAOs than that on the xDAI network I assume if correct - how does the API handle pagination?
The text was updated successfully, but these errors were encountered: