Talk and codebase for Building APIs in GraphQL Presentation
Ensure you have the following dependencies:
source ~/venv/bin/activate
pip install django==2.1.4 graphene-django==2.2.0 django-filter==2.0.0 django-graphql-jwt==0.1.5
cd /yourproject/graphpod
python manage.py migrate
python manage.py runserver
All migrations are already applied however if you edit any of the models.py files then simply tell Django to regenerate the migrations and run the new migrations like so:
python manage.py makemigrations
python manage.py migrate
The presentation can be found in the slides/
folder
All queries are stored in graphpod/queries.graphql
Schema design is stored in graphpod/designedschema.graphql
Please refer to the queries.graphql to see how to authenticate. Run the createUser and tokenAuth mutations to get the token of your user. Once you have obtained the token, you will
have to alter your headers in the GraphiQL client. As an example, you would set the Authentication
header key to
JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
You can view the database at graphpod/graphpoddb.sqlite3
using a SQLite Database Viewer such as SQLite Browser