Boston Python User Group collaborative project
- Welcome! The purpose of this repository is to serve as an introduction to GraphQL using Python.
- This repository began at a Boston Python User Group meeting on May 20, 2019.
- We are using Flask as a simple web server.
- The GraphQL features are implemented using Graphene Python.
- This example does not yet cover subscriptions, which will be covered at a later date.
From the command line:
brew install git node python pipenv postgresqlcd path/where/you/want/the/repo
git clone git@github.com:ProjectCheshire/graphql-python-starter.gitIn repository directory:
pipenv install --devpipenv shell
graphql-python-starter-hash ❯ pre-commit installgraphql-python-starter-hash ❯ python manage.py db init
graphql-python-starter-hash ❯ python manage.py db upgrade
graphql-python-starter-hash ❯ python manage.py db migrate
graphql-python-starter-hash ❯ python seed_db.pyIf you run into errors, try:
-
Deleting the migrations directory: If you receive
Error: Directory migrations already exists, delete themigrations/directory and re-runpython manage.py db init. -
Delete the files inside
/migrations/versions, but don't delete the/versionsdirectory itself. -
Re-creating the database:
graphql-python-starter-hash ❯ psql postgres
psql (version) Type "help" for help. user=$ DROP DATABASE starwars; DROP DATABASE user=$ CREATE DATABASE starwars; CREATE DATABASE user=$ \q
graphql-python-starter-hash ❯ psql -d starwars
# psql (version)
# Type "help" for help.
starwars=$ \dt
List of relations
Schema | Name | Type | Owner
--------+-----------------+-------+-------------
public | alembic_version | table | user
public | factions | table | user
public | heroes | table | user
public | memberships | table | user
public | planets | table | user
(5 rows)
starwars=# \q
Make sure you have Node downloaded
Command-line instructions
cd client
# Install all dependencies
npm i
# Create and run js bundle
npm run startComing soon!
See the contributing guidelines for more detailed instructions.
Please abide by the guidelines in the Code of Conduct.