Coder Social home page Coder Social logo

graphene-python-poc's Introduction

Sobre

  • Uma simples aplicação Python.
  • Utilizado a biblioteca Graphene para realizar consultas e escritas no formato GraphQL.
  • Aplicado uma leve organização de pastas
  • Usado o conceito de views para misturar python code com linguagem de marcação isoladamente.

Subir a aplicação com docker-compose

docker compose up -d --build

[+] Running 1/1
 ⠿ Container python-server  Started

Subindo a aplicação manualmente

$ docker build -t python-server-image .

$ docker run -p 8080:8082 \
    --mount type=bind,src=$(pwd)/source,dst=/usr/src/app/source \ 
    -it \
    --name python-server python-server-image

Subindo a aplicação sem docker

$ python3 source/main.py
Server started http://0.0.0.0:8082

Como testar

{
	"CreateHero": {
		"id": "4",
		"name": "Jose",
		"type": "Droid",
		"languages": [{
			"description": "droid_language",
			"native": true
		}],
		"hability": "sleep"
	}
}
{
	"hero": {
		"id": "1",
		"name": "Droid: one",
		"type": "Droid",
		"languages": [{
			"description": "droid_language",
			"native": true
		}],
		"hability": "eat"
	}
}
{
	"hero": {
		"id": "5",
		"name": "Dev: two",
		"type": "Developer",
		"languages": [{
			"description": "javascript",
			"native": false
		}],
		"company": "apple"
	}
}
{
	"heroes": [{
		"id": "6",
		"name": "Dev: three",
		"type": "Developer",
		"languages": [{
			"description": "python",
			"native": false
		}],
		"company": "police"
	}, {
		"id": "1",
		"name": "Droid: one",
		"type": "Droid",
		"languages": [{
			"description": "droid_language",
			"native": true
		}],
		"hability": "eat"
	}]
}

Observações

  • Todos os dados estão mocados, ou seja, NÃO existe persistência alguma dos dados enviados.
  • IDS menores ou iguais a 10, serão considerados como Droids. Maiores que 10, serão considerados Devs.

Referências

graphene-python-poc's People

Contributors

zevitagem avatar

Watchers

 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.