
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
.. image:: https://circleci.com/gh/Mergifyio/graphql-utils.svg?style=svg :target: https://circleci.com/gh/Mergifyio/graphql-utils
.. image:: https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/Mergifyio/graphql-utils&style=flat :target: https://mergify.com :alt: Mergify Status
The graphql-utils
Python package is a collection of utilities function for
interacting with GraphQL libraries. It is meant to be library agnostic so it
should work with whatever library or protocol you want.
The multi-requests module allows you to send a request multiple times with different parameter. It also supports pagination, making sure that you'll get all the results for all the requests you sent.
Example::
import requests
from graphql_utils import multi
def requests_api(query): return requests.post("https://myapi.com/graphql", json=query)
userlist = ( {"login": "jd"}, {"login": "sileht"}, {"login": "foo"}, {"login": "bar"}, )
result_iterator = multi.multi_query(""" user(login: "{login}") {{ pets(first: 100{after}) {{ nodes {{ name }} pageInfo {{ hasNextPage endCursor }} }} }}""", iterable=userlist, pageinfo_path=("pets", "pageInfo"), send_fn=requests_api, )
This will send one GraphQL requests with 4 queries (one for each user from
userlist
). As pageinfo_path
was specified, if any of the query does not
return all information in one request, a new query using the endCursor
will
be automatically sent to get the next results.
FAQs
Useful function when interacting with GraphQL APIs
We found that graphql-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.