graphql-mesh
graphql-mesh copied to clipboard
Cannot use container name for redis cache
As the moment passing the container name for redis cache like this:
cache:
redis:
port: "6379"
host: "redismesh"
password: "redis"
it will not resolve to the IP of the container.
Could you please create a reproduction? Thanks!
here is part of the docker compose file:
graphqlmesh:
depends_on:
- redismesh
container_name: graphqlmesh
build:
context: ./mesh
dockerfile: Dockerfile
ports:
- 3002:3002
volumes:
- ./mesh:/usr/app
redismesh:
container_name: redismesh
image: "bitnami/redis:latest"
ports:
- "3003:6379"
environment:
- REDIS_PASSWORD=redis
volumes:
- ./redis/data:/bitnami/redis/data
- ./redis/conf/overrides.conf:/opt/bitnami/redis/mounted-etc/overrides.conf
here is my .meshrc.yaml :
sources:
- name: expresstest
handler:
jsonSchema:
endpoint: http://express:3001
operations:
- type: Query
field: user
path: /user
method: GET
responseSample: ./json-samples/user.json
responseTypeName: User
transforms:
- filterSchema:
mode: wrap
filters:
- User.!name
plugins:
- responseCache: {}
- prometheus:
requestCount: true
requestSummary: true
parse: true
validate: true
contextBuilding: true
execute: true
errors: true
resolvers: true
deprecatedFields: true
# endpoint: /metrics
serve:
port: 3002
hostname: 0.0.0.0
cache:
redis:
port: "6379"
host: "redismesh"
password: "redis"
on graphql mesh start, no configuration error is printed, but on launch of Yoga graphiQL and attempts at fetching the schema i get timed out error.
Could you provide a minimal isolated reproduction on GitHub at least as we asked in our bug report template? https://github.com/Urigo/graphql-mesh/issues/new?assignees=&labels=&template=bug_report.md
Here is a reproduction in codsandbox link here First issue i ever opened, please inform me if there is anything else i should add.
Sorry for late response but I cannot access the link you shared. Maybe you can create a reproduction on GitHub.
yes, link is dead. i'll try to make permanant repo for it
I've managed to setup a repo with a minimal exemple. As previously mentioned when i refer to redis container with the container name, GraphQL mesh won't resolve it to proper adress and logs an error in terminal. Replacing it with actual IP (found through docker inspect), does not produce an error on request and i assume is working properly. https://github.com/Mehdi-Mani/MeshTest2023
@Mehdi-Mani Did you manage to fix the issue? I also have the same problem with my setup to use redis with GraphQL-Mesh
@mnlbox Unfortunaly no. I was currently using Mesh for an end of studies project and i could afford bypassing the issue all together for my presentation demo. Hopefuly since it is currently roadmap, a fix will eventualy be released.
@ardatan @Mehdi-Mani As Mesh also using ioredis
maybe related: 🤔
https://github.com/luin/ioredis/issues/763