Graphql backend that assists you in securing your GraphQL API against malicious queries
Project description
graphql-limits
Features included:
- Limit Query Depth
- Limit Query Nodes
Prerequisites
Installation
pip install graphql-limits
Usage example
query_string = '''
query Test($first: Int) {
viewer {
books(first: $first) {
author {
books(first: 4) {
author {
books(first: 100) {
author {
id
}
}
}
}
}
}
}
}
'''
schema = graphene.Schema(query=Query)
backend = ProtectorBackend(nodes_limit=399, depth_limit=5, variable_values={'first': 2})
result = schema.execute(query_string, backend=backend, variable_values={'first': 2})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
graphql-limits-0.1.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for graphql_limits-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95fd6575e718f6c1de203399b45a78a524a2447282ee17d3c89db27148bf286c |
|
MD5 | 382aea7ca930de3cfe680dff65788cb3 |
|
BLAKE2b-256 | c470e09e38ce431f3ccd65d307d65535696537b9539cdb7a03270fa6390c7710 |