Comments (1)
The issue was on my end (sort of) I needed to add "Content-Type": "application/json"
to the headers and it started working almost how you would expect. The only reason why I say "sort of" is because the "total" is still 100.
Anyway I cleaned up the code a little so it looks a little different but here is my fix for anyone else having the same issue.
import requests
import json
def getRequest( frm=0, size=20 ):
return requests.post( 'https://graphql-gateway.axieinfinity.com/graphql', json={
"headers": {
"operation": "GetRecentlyAxiesSold",
"Content-Type": "application/json"
},
"query": '''
query GetRecentlyAxiesSold($from: Int, $size: Int) {
settledAuctions {
axies(from: $from, size: $size) {
total
results {
...AxieSettledBrief
}
}
}
}
fragment AxieSettledBrief on Axie {
id
}
''',
"variables": {
"from": frm,
"size": size
}}
)
x, y = [getRequest(frm = 40, size = 5).json()["data"]["settledAuctions"]["axies"],
getRequest(frm = 0, size = 5).json()["data"]["settledAuctions"]["axies"]]
total = int(x["total"])
results_x, results_y = [ x["results"], y["results"] ]
id_x, id_y = [ results_x[0]['id'], results_y[0]['id'] ]
#Size Test
#assert ( total == 5 )
assert ( len(results_x) <= 5 )
#From Test
assert ( id_x != id_y )
from axie-graphql-documentation.
Related Issues (20)
- GetAxieBriefList auction value? HOT 1
- Ever had to deal with 403 Forbidden response? HOT 1
- API crashed? HOT 1
- SLP? HOT 1
- POST request also possible or not ? HOT 2
- GetAxieBriefList Operation HOT 2
- Get list of all abilities HOT 2
- GraphQL Json Scheme HOT 1
- Spelling error in response for abilities description for Nile Strike, "Appy Speed- to target for 2 rounds." HOT 1
- Minimal queries HOT 2
- Get MMR of a player HOT 7
- GetAxieDetail Query HOT 2
- can you collect the leaderboard and battle api? HOT 1
- Internal Server Error 500 on GetAxieDetail request HOT 1
- GetAxieBriefList does not show auction information HOT 1
- Multiple IDS on Graphql API HOT 1
- Pagination issue HOT 7
- Authentication failure
- Number of returns
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axie-graphql-documentation.