- TypeDefs
- Query
- Mutation
- GraphQL Schema Language
This is the minimum workshop setup. Please prepare the project as described below.
git clone https://github.com/Speedy1991/graphql_workshop.git
cd graphql_workshop
- If you want to use a virtual environment click here for instructions
pip install -r requirements.txt
python manage.py migrate
python manage.py loaddata assets/initial
(Installed 91 object(s) from 1 fixture(s))python manage.py runserver
git clone https://github.com/Speedy1991/graphql_workshop.git
cd graphql_workshop
docker-compose up --force-recreate --build
- Open your browser and visit
http://127.0.0.1:8000/admin
and try to login withadmin:12345
- Write your first TypeDefs and resolvers
- Extend your TypeDefs with more complex resolvers
- Refactor with
django-graphene
- Write a custom resolver
- Add Query Arguments
- Write a mutation
- Refactor
- Replace mutation arguments with an InputType
- Use EnumType
- Interfaces
- Polymorphic & interfaces
- Some LiveCoding with AbstractTypes, etc.
This is a very exercise-heavy workshop. You'll finde the exercises in the graphql_workshop/exercise[number] directory. Don't forget to change the used schema in the settings.
You find some helpful content on the Docs:
- TODO: This is your job
- DOCS: This will give you a link to the specific doc page
- DJANGO: This will help you with some django specific code
- HINT: This will give you some useful tips
- QUESTION: Try to answer the question yourself - if you don't find the answer, feel free to ask :)
SELECT * FROM <table>
-><ModelName>.objects.all()
SELECT * FROM <table> WHERE id=<id>
-><ModelName>.objects.get(id=id)
(raises if not exist)
This material is available for private, non-commercial use under the GPL version 3.
If you would like to use this material to conduct your own workshop, please contact me at arthur.holz.91@gmail.com