简体   繁体   English

如何创建接受多个 ID graphql 的过滤器?

[英]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.

相关问题 如何通过功能工具中的多个 id 创建新变量? - How to create new variables by multiple ids in featuretools? 使用 GraphQL 和石墨烯进行多级过滤 - Filter at multiple levels with GraphQL and Graphene 如何创建一个新的数据框,在对 ID 进行分组时,它在另一列的条件下取 1 列的平均值 - How to create a new data frame which takes average of 1 column on the condition of another column whilst grouping the IDs 如何为许多唯一 ID 创建多组子图 - How to create multiple groups of subplots for many unique ids 如何为使用一个类的多个对象作为参数的类创建方法? - How to create a method for a class that takes multiple objects of a class as arguments? 如何使用 django rest 框架从 GET 请求的查询参数中过滤多个 id? - How to filter for multiple ids from a query param on a GET request with django rest framework? 如何为微服务创建 Graphql 服务器? - How to create Graphql server for microservices? 如何更新graphql查询字符串正文中的过滤器? - How to update filter in graphql query string body? 根据多个 IF 条件创建具有新 ID 的列 - Create column with new IDs based on multiple IF Conditions 如何在django-views中创建多重过滤器? - How do I create a multiple filter in django-views?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM