Skip to main content

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

NameTypeRequiredDescription
TOKENstringYesService token
PATHstringNo
default:/graphql
Path to GraphQL schema file
GRAPHENE_SCHEMAstringNo
default:GRAPHENE.SCHEMA
Path to graphene schema instance
SCHEMA_PATHstringNoPath to GraphQL schema file
DEBUGboolNo
default: False
Enable debug mode