Skip to content

Graphql backend that assists you in securing your GraphQL API against malicious queries

License

Notifications You must be signed in to change notification settings

shafa-dev/graphql-limits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-limits

Features included:

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

About

Graphql backend that assists you in securing your GraphQL API against malicious queries

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages