Skip to content

Laravel 7, GraphQL, Docker, PHP 7.4, PHPCS, PHPStan e MySQL 8

Notifications You must be signed in to change notification settings

jgcl/laravel-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel 7, GraphQL, Docker, PHP 7.4, PHPCS, PHPStan e MySQL 8

dockeri.co

Simples projeto usando Docker com PHP 7.4, uma API com GraphQL e MySQL, PHPCS/PHPStan para lint dentre outros.

Plugins:

Deploy com docker

docker-compose pull
docker-compose up -d
docker exec -it app php artisan config:clear
docker exec -it app php artisan migrate

Deploy sem Docker

Requisitos:

Rodar:

php artisan migrate
php artisan serve --host=127.0.0.1 --port=80

GraphQL

Exemplos

  • Depósito:
curl --location --request POST 'http://localhost:80/graphql' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
	"query": "mutation { depositar(conta:1, valor:50.00) { conta, saldo } }"
}'
  • Saque:
curl --location --request POST 'http://localhost:80/graphql' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
	"query": "mutation { sacar(conta:1, valor:50.00) { conta, saldo } }"
}'
  • Saldo:
curl --location --request POST 'http://localhost:80/graphql' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
	"query": "query { saldo(conta:1) }"
}'

Testes

./vendor/bin/phpstan analyse ./app --level=1
./vendor/bin/phpcs --standard=PSR12 ./app
./vendor/bin/phpcbf --standard=PSR12 ./app
./vendor/bin/phpunit --coverage-html ./public/codecoverage
./vendor/bin/phpunit --coverage-text

About

Laravel 7, GraphQL, Docker, PHP 7.4, PHPCS, PHPStan e MySQL 8

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published