Giter VIP home page Giter VIP logo

strawberry-workshop's Introduction

Introduction to GraphQL and Strawberry

Workshop Outline

  • TypeDefs
  • Query
  • Mutation
  • GraphQL Schema Language

System Requirements

  • git v2 or greater
  • python3.11 or greater + pip (maybe a lower version will work too - please try it yourself)

This is the minimum workshop setup. Please prepare the project as described below.

Pre-Workshop Instructions/Requirements (install)

  • git clone https://github.com/Speedy1991/strawberry-workshop.git
  • cd strawberry-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/data.json (Installed 206 object(s) from 1 fixture(s))
  • python manage.py runserver

Test your setup

  • Open your browser and visit http://127.0.0.1:8000/admin/ and try to login with root:toor
  • The GraphiQL endpoint is at http://127.0.0.1:8000/graphql/

Exercise overview

You will have about 10 min per exercise. Do not forget to reload your graphiql endpoint after you changed the schema to refelect the changes

Working through it

This is a very exercise-heavy workshop. You'll find the exercises in the strawberry_workshop/exercise[number] directory. Don't forget to change the used schema in the urls.py.

You find some helpful content on the Docs:

Helpful shortcuts

  • 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 :)

Django Cheatsheet

  • SELECT * FROM <table> -> <ModelName>.objects.all()
  • SELECT * FROM <table> WHERE id=<id> -> <ModelName>.objects.get(id=id) (raises if not exist)

Database overview

Database overview

Strawberry

Docs: https://strawberry.rocks/

Discord: https://strawberry.rocks/discord (be friendly, this is an awesome community)

Github: https://github.com/strawberry-graphql/strawberry

Creator: Patrick Thank you so much for creating this awesome framework

Core Devs: bellini666, DoctorJohn, erikwrede, skilkis

In this context, we should generally express our gratitude to all open-source developers and contributors.

License

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 [email protected]

Closing

If you enjoyed the workshop, Patrick would surely appreciate a small sponsorship to support his open-source work going forward.

strawberry-workshop's People

Contributors

speedy1991 avatar codaubianca avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.