https://github.com/avara1986/graphql-django
Implementación en Django de Graphql
https://github.com/avara1986/graphql-django
django phython-3
Last synced: about 1 year ago
JSON representation
Implementación en Django de Graphql
- Host: GitHub
- URL: https://github.com/avara1986/graphql-django
- Owner: avara1986
- License: mit
- Created: 2017-09-10T18:28:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-10T18:35:55.000Z (over 8 years ago)
- Last Synced: 2025-01-02T13:20:36.262Z (about 1 year ago)
- Topics: django, phython-3
- Language: Python
- Size: 18.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Graphql + Python + Django
Implementación de Python de [Paradigma: Graphql + Spring Boot](https://github.com/paradigmadigital/graphql-spring-boot)
## Frameworks utilizados:
- [Django](https://github.com/django/django)
- [Graphene-django](https://github.com/graphql-python/graphene-django)
## Requisitos
Python 3.x
Django
graphene-django
Ver requirements.txt
## Configuración
```
virtualenv --python=python3.6 venv
source venv/bin/activate
pip install -r requirements.txt
cd factory
python manage.py migrate
python manage.py loaddata cars/fixtures/01_initial_data.json
```
## Ejecución
```
python manage.py runserver
```
## Esquema
Accede tu mismo al [editor de consultas](http://localhost:8000/graphql) del proyecto una vez arrancado
Ejemplos de consultas y mutaciones:
```graphql
{
cars {
id
}
}
```
```graphql
mutation {
createCar(model: 1,color:"brown"){
car{
id
color
}
ok
}
}
```
```graphql
{
cars {
id
color
model {
id
name
}
}
models{
id
}
car(id: "_id_que_corresponda_"){
id
}
}
```