https://github.com/jefersoneiji/graphql-subscriptions-template
A GraphQL server template with subscriptions configured and managed by redis
https://github.com/jefersoneiji/graphql-subscriptions-template
graphql graphql-subscriptions nexus-graphql nodejs redis typescript
Last synced: 3 months ago
JSON representation
A GraphQL server template with subscriptions configured and managed by redis
- Host: GitHub
- URL: https://github.com/jefersoneiji/graphql-subscriptions-template
- Owner: jefersoneiji
- Created: 2023-12-19T20:22:00.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-21T13:04:25.000Z (almost 2 years ago)
- Last Synced: 2025-04-06T22:18:45.432Z (6 months ago)
- Topics: graphql, graphql-subscriptions, nexus-graphql, nodejs, redis, typescript
- Language: TypeScript
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
Graphql Subscriptions Template
This template is meant to be used in back-end development.## Requirements
This template requires a local redis server running on `127.0.0.1:7000` .
To set up locally do this:1. Spin a Redis in Docker server and cluster
```cmd
docker run -e "IP=0.0.0.0" -p 7000-7005:7000-7005 grokzen/redis-cluster:latest
```
2. Then inside the container terminal
```cmd
redis-cli -c -p 7000
```
3. And then set protected-mode to "no"
```cmd
config set protected-mode no
```Redis set-up finished!
## Installation
1. Clone this repository
```cmd
https://github.com/jefersoneiji/graphql-typescript-template.git
```
2. Install dependencies
```cmd
yarn install
```
3. To run this project execute
```cmd
yarn start
```## Accessing GraphiQL
Use this address
```
http://localhost:4000/graphql
```## Docker
1. To build the image type
```cmd
docker build -t graphql-typescript-template .
```
2. Create and run containers from image
```cmd
docker run -dp 127.0.0.1:4000:4000 graphql-typescript-template
```
3. Open container in editor
For vscode, you may use the dev containers extension
```cmd
https://code.visualstudio.com/docs/devcontainers/containers
```## Known issues
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.