Python Flask Middleware
The Inigo plugin for the Python Flask provides full observability and controls on all individual subgraphs. Follow the instructions to get up and running.
Installation
pip install inigo-py
Get token
- Set up a service and a token. If you still need one, follow Getting Started.
Integration
from inigo_py.flask import Middleware
app = Flask(__name__)
config = {
...
'INIGO': { # inigo config
'TOKEN': os.environ.get('INIGO_SERVICE_TOKEN', ''),
'PATH': '/query',
'GRAPHENE_SCHEMA': 'app.schema.schema',
},
}
app.config.update(config)
app.wsgi_app = Middleware(app) # use inigo middleware
if __name__ == '__main__':
app.run(host="0.0.0.0", port=80, use_reloader=False)
Other configuration options
Name | Type | Required | Description |
---|---|---|---|
TOKEN | string | Yes | Service token |
PATH | string | No default: /graphql | Path to GraphQL schema file |
GRAPHENE_SCHEMA | string | No default: GRAPHENE.SCHEMA | Path to graphene schema instance |
SCHEMA_PATH | string | No | Path to GraphQL schema file |
DEBUG | bool | No default: False | Enable debug mode |