Skip to content

Latest commit

History

History

graphql

Folders and files

NameName
Last commit message
Last commit date

parent directory

..

Using GraphQL for queries

The following example demonstrates how to query the database using GraphQL. For this, we will start a server which will handle all incoming requests. The server will be started on http://localhost:8000 and the GraphQL playground will be available on http://localhost:8000/graphql.

Database setup

This example includes a docker-composerecipe to spawn a new instance of a MySQL database. For this, run the following command:

sudo docker-compose up --build  # Start MySQL database
python populate_db.py           # Populate database
strawberry server schema        # Run server

example