graphql-hive / gateway

GraphQL gateway that can act as a Federation Gateway or a Proxy Gateway for any GraphQL service.
https://the-guild.dev/graphql/hive/docs/gateway
MIT License
13 stars 3 forks source link

Hive Gateway: Is `graphql-middleware` an "undocumented" peer dependency? #149

Closed klippx closed 5 days ago

klippx commented 5 days ago

When starting the hive gateway I am getting this error:

Error: Cannot find module 'graphql-middleware'
Require stack:
- /Users/MKLIPPIN/repos/graphql-federation-mono/node_modules/graphql-shield/cjs/shield.js
- /Users/MKLIPPIN/repos/graphql-federation-mono/node_modules/graphql-shield/cjs/index.js
- /Users/MKLIPPIN/repos/graphql-federation-mono/node_modules/graphql-rate-limit/dist/index.js

The only way to resolve it is to add graphql-middleware as a dependency. Is this an undocumented peer dependency of @graphql-hive/gateway as I expected it to be standalone for the most part? And this peer dep comes from quite a bit underneath (some middleware).

Or is this an unfortunate result of relying on the dead graphql-rate-limit repo? 💩 🫢

I created a code sandbox to reproduce the issue: https://codesandbox.io/p/devbox/github/klippx/hive-gateway-sandbox-template

As a side effect, I ended up making a codesandbox template 🫡 (available here)

enisdenjo commented 5 days ago

Thanks for reporting this. graphql-middleware shouldnt be a peer dep here, it's probably caused by the rate limitting plugin. We'll fix it soon.