Skip to content

A GraphQL server template with subscriptions configured and managed by redis

Notifications You must be signed in to change notification settings

jefersoneiji/graphql-subscriptions-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql image

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
docker run -e "IP=0.0.0.0" -p 7000-7005:7000-7005 grokzen/redis-cluster:latest
  1. Then inside the container terminal
redis-cli -c -p 7000
  1. And then set protected-mode to "no"
config set protected-mode no

Redis set-up finished!

Installation

  1. Clone this repository
https://github.com/jefersoneiji/graphql-typescript-template.git
  1. Install dependencies
yarn install 
  1. To run this project execute
yarn start

Accessing GraphiQL

Use this address

http://localhost:4000/graphql

Docker

  1. To build the image type
docker build -t graphql-typescript-template .
  1. Create and run containers from image
docker run -dp 127.0.0.1:4000:4000 graphql-typescript-template
  1. Open container in editor For vscode, you may use the dev containers extension
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.

About

A GraphQL server template with subscriptions configured and managed by redis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published