This template is meant to be used in back-end development.
This template requires a local redis server running on 127.0.0.1:7000
.
To set up locally do this:
- Spin a Redis in Docker server and cluster
docker run -e "IP=0.0.0.0" -p 7000-7005:7000-7005 grokzen/redis-cluster:latest
- Then inside the container terminal
redis-cli -c -p 7000
- And then set protected-mode to "no"
config set protected-mode no
Redis set-up finished!
- Clone this repository
https://github.com/jefersoneiji/graphql-typescript-template.git
- Install dependencies
yarn install
- To run this project execute
yarn start
Use this address
http://localhost:4000/graphql
- To build the image type
docker build -t graphql-typescript-template .
- Create and run containers from image
docker run -dp 127.0.0.1:4000:4000 graphql-typescript-template
- Open container in editor For vscode, you may use the dev containers extension
https://code.visualstudio.com/docs/devcontainers/containers
Q: After the container is opened, git may show some files as modified although nothing was changed.
A: In this case, just discard all "changes" and you're good to go.
Q: My GraphiQL doesn' connect to my websocket endpoint.
A: For some reason the websocket endpoint is not connecting to the graphiql interface. Use another GraphQL client, such as Postman.