Home Applications iris-graphql-demo

iris-graphql-demo

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
0
0 reviews
0
Awards
2
Views
0
IPM installs
0
0
Details
Releases  (1)
Reviews
Issues
Example of using GraphQL with InterSystems IRIS with Graphene, S

What's new in this version

Initial Release

Example of using GraphQL with InterSystems IRIS with Graphene, SQLAlchemy and Flask.

What are the goals of this example?

  • Create a sample Employee, Department data model in InterSystems IRIS
  • Implement a GraphQL server to query and modify data

What do you need to install?

Setup

Run 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

Create some sample data

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

Run GraphQL server

There is a GraphQL server implementation ready for you to test:

cd graphql-server
python app.py

Test your GraphQL implementation

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

Version
1.0.027 Nov, 2024
Category
Technology Example
Works with
InterSystems IRIS
First published
27 Nov, 2024