With pagination. This is to demonstrate a very fast Django 5.0 GraphQL API application that can query as databse with millions of rows. https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/daphne/
- Clone the repo
- Navigate to project root and create virtual environment:
python -m venv venv - Activate the virtual env using
source ./venv/bin/activate - Install requirements from the requirements.txt file using pip
python -m pip install -r requirements.txt
- Run migrations
python manage.py migrate - Seed database with data using:
python manage.py seed_database - Run dev server
python manage.py runserver
- browse graphQL endpoint at http://localhost:8000/graphql/
query allposts {
allPosts(offset: 0, limit: 50) {
items {
id
title
author {
id
}
}
itemsCount
}query allposts {
allPosts(offset: 0, limit: 50) {
items {
id
title
author {
id
}
}
itemsCount
}
allAuthors(offset: 0, limit: 20) {
items {
id
name
}
itemsCount
}
}Free
- https://github.com/strawberry-graphql/strawberry
- https://strawberry-graphql.github.io/strawberry-graphql-django/
- https://www.djangoproject.com/
© 2024-2042, David Syengo. All rights reserved.