Skip to content

syengo254/Async-django-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async Django + Strawberry GraphQL + Daphne

Description

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/

Instructions

  1. Clone the repo
  2. Navigate to project root and create virtual environment:
    python -m venv venv
    
  3. Activate the virtual env using source ./venv/bin/activate
  4. Install requirements from the requirements.txt file using pip
    python -m pip install -r requirements.txt
  5. Run migrations python manage.py migrate
  6. Seed database with data using: python manage.py seed_database
  7. Run dev server
    python manage.py runserver
  8. browse graphQL endpoint at http://localhost:8000/graphql/

Test Query

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
  }
}

License

Free

Credits

Copyright

© 2024-2042, David Syengo. All rights reserved.

About

A Django v5.0 app that is async using Daphne and strawberry GraphQL for the API endpoint

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages