Sign inSign up

shanelee007/graphql-playground

By shanelee007

Updated almost 8 years ago

graphql server

Image
0

242

shanelee007/graphql-playground repository overview

Postgres setup

docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres

PSQL commands

docker exec -it some-postgres bash
psql -d postgres -U postgres
\l #list databases
\dt #list tables
\dn #list schemas
\s #command history

SELECT * from users;
SELECT text from messages;

Install PgAdmin

https://www.pgadmin.org/download/

Setup

nvm use
yarn
cp .env.example .env
yarn start

Authz

Sample headers

{"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NywiZW1haWwiOiJzbGVlMUBzZWVrLmNvbS5hdSIsInVzZXJuYW1lIjoic2hhbmUxIiwiaWF0IjoxNTQzODA5NjU2LCJleHAiOjE1NDM4MTE0NTZ9.hKV1vR6kV3hCCAMxBtGsuXeZ5MUq1TIwQSGcvk_gb_M"}

Error handling

Error handling

TODO

To disable stacktraces for production, pass debug: false to the Apollo server constructor or set the NODE_ENV environment variable to ‘production’ or ‘test’. Note that this will make the stacktrace unavailable to your application. If you want to log the stacktrace, but not send it in the response to the client, see Masking and logging errors below.

Docker

docker build   -t shanelee007/graphql:1.0.0 -t  shanelee007/graphql:latest .
docker run -d -p 8000:8000 --link some-postgres  shanelee007/graphql:1.0.0

TODO

  • skaffold for local testing
  • kubernetes manifests
  • add in renovate and circleci
  • add in rest datasource example

Resources

Tag summary

Content type

Image

Digest

Size

90 MB

Last updated

almost 8 years ago

docker pull shanelee007/graphql-playground