© 2024 InterSystems Corporation, Cambridge, MA. All rights reserved.Privacy & TermsGuaranteeSection 508Contest Terms
Initial Release
Example of using GraphQL with InterSystems IRIS with Graphene, SQLAlchemy and Flask.
Employee
, Department
data model in InterSystems IRISRun an InterSystems IRIS Community edition instance:
docker compose build
docker compose up -d
Create a Python virtual environment for this project:
# create a local venv environment python3 -m venv .venv
activate venv
source .venv/bin/activate
install dependencies
pip3 install -r requirements.txt
Open an interactive Python session and run a method to initialize your data model and insert some data.
cd graphql-server
python
from models import db_session, engine, Base, Department, Employee
# create tables
Base.metadata.create_all(bind=engine)
# create some data
from app import init_data
init_data()
There is a GraphQL server implementation ready for you to test:
Employee
and Department
./graphql
and /graphql-relay
endpoints for both schemas (relay and not relay).cd graphql-server
python app.py
You can import collection_iris-graphql-demo.json in Postman or ThunderClient for VS Code and check the output.
There is also a GraphiQL UI available at http://localhost:5000/graphql