跳转到主要内容

Graphql后端,帮助您保护GraphQL API免受恶意查询的攻击

项目描述

graphql-limits

包含的功能

先决条件

安装

  • pip install graphql-limits

使用示例

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})

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

graphql-limits-0.1.1.tar.gz (5.1 kB 查看哈希值)

上传时间 源代码

构建分发

graphql_limits-0.1.1-py2.py3-none-any.whl (4.2 kB 查看哈希值)

上传时间 Python 2 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面