[英]How to create filter that takes in multiple ids graphql?
I have the following graphql query:我有以下 graphql 查询:
axie_list = [] #f'"{1621247}"'
for ids in tqdm(id_groups[:2]):
query = {"operationName": "GetAxieDetail",
"variables": {"axieId": ids},
"query": "query GetAxieDetail($axieId: IDS!) {\n axie(axieId: $axieId) {\n ...AxieDetail\n }\n}\n\nfragment AxieDetail on Axie {\n id\n class\n breedCount\n bodyShape\n sireClass\n matronClass\n stage\n level\n \n parts {\n ...AxiePart\n }\n stats {\n ...AxieStats\n }\n}\n\nfragment AxiePart on AxiePart {\n name\n type\n}\n\nfragment AxieStats on AxieStats {\n hp\n speed\n skill\n morale\n}"}
url = 'https://axieinfinity.com/graphql-server-v2/graphql'
json_data = requests.post(url, json=query).json()
axie_list.append(json_data)
This query takes in 1 id
like this "1621247"
at a time.此查询一次接收 1 个像
"1621247"
这样的id
。 I have a group of ids
in a list and would like to call the ids
in bulk instead of 1 at a time.我在列表中有一组
ids
,并且想批量调用这些ids
而不是一次调用 1 个。 How would something like this look like?像这样的东西会是什么样子?
graphql api 不允许这样做的朋友。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.