Skip to content

Implementation of GraphQL's documentation/tutorial using pyramid

Notifications You must be signed in to change notification settings

coleschneider/swapi-pyramid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL SWAPI using Graphene, Pyramid, and SQLAlchemy

This is a integration example of Graphene in Pyramid.

Structure

All the models and fixtures are based in the original swapi project.

The schema can be found in starwars/schema.py.

For filters, SQLAlchemy doesnt support graphene filters so graphene sql alchemy filter

Deploying locally

You can also have your own GraphQL Starwars example running on locally. Just run the following commands and you'll be all set!

git clone git@github.com:coleschneider/swapi-pyramid.git
cd swapi-pyramid

# Create a virtual environment
python3 -m venv env && export ENV=./env

# Install the requirements
$ENV/bin/pip install -r requirements_base.txt

# Install in development mode
$ENV/bin/pip install -e .

# Initialize the database with fixtures
$ENV/bin/initialize_db development.ini

# Start server
$ENV/bin/pserve development.ini --reload

Visit localhost:6543/graphql

Testing

# Run tests with logging enabled
$ENV/bin/py.test ./starwars/tests/tests.py -s

# Run tests and update snapshots
$ENV/bin/py.test ./starwars/tests/tests.py -s --snapshot-update

Releases

No releases published

Packages

No packages published

Languages