Skip to content
Branch: master
Find file History
Pull request Compare This branch is 2 commits ahead of steveluscher:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
ingredients
people
utils
zero_django
.gitignore
.python-version
README.md
db.sqlite3
manage.py
requirements.txt
schema.json

README.md

Django example

Prerequisites

  • Xcode Command Line Tools

    # Download from (https://developer.apple.com/xcode/download/)
    xcode-select --install
    
  • Python >=3.5.0

    # Install pyenv with Homebrew (https://github.com/yyuu/pyenv#homebrew-on-mac-os-x)
    brew install pyenv
    # Install Python 3 with pyenv
    cd zero-django
    pyenv install
    

Installation

cd zero-django
pip install -r requirements.txt

Running the example

./manage.py runserver

Visit http://localhost:8000/graphiql

Query String

query {
  person(id:"1") {
    id
    firstName
    lastName
    email
    friends {
      firstName
      email
    }
  }
}

导出 Schema

安装之后

INSTALLED_APPS += ('graphene_django')

可以使用如下命令导出 Schema

./manage.py graphql_schema --schema zero_django.schema.schema --out schema.json

更多参考这里

create app

django-admin.py startapp ingredients

loadata

python manage.py loaddata ingredients/ingredients.json

reference

You can’t perform that action at this time.