Django Graphene example

by Jpadilla1

GitHub Readme.md

django-graphene-example

A Django app to explore the Graphene framework for Python

Running Locally

Make sure you have Python installed properly. Also, install the Heroku Toolbelt and Postgres.

$ git clone https://github.com/Jpadilla1/django-graphene-example.git
$ cd django-graphene-example

$ pip install -r requirements.txt

$ createdb django_graphene_example

$ python manage.py migrate
$ python manage.py loadtestdata posts.Post:20
$ python manage.py loadtestdata comments.Comment:30

$ heroku local

Your app should now be running on localhost:5000.

Deploying to Heroku

$ heroku create
$ git push heroku master

$ heroku run python manage.py migrate
$ heroku open

or

Deploy

Documentation

For more information about using Python on Heroku, see these Dev Center articles:

Example Query

First 2 posts with 5 comments each

query {
  allPosts(first: 2) {
    edges {
      node {
        id,
        title,
        author,
        comment(first: 5) {
          edges {
            node {
              text
            }
          }
        }
      }
    }
  }
}