Express js middleware’s integration error with apollov4 #7778
-
I’m using Express js with @apollo/server & installed various middleware e.g: morgan, cors, cookieParser. But they didn’t executed.
Applied middleware doesn’t executing e.g: Didn’t executed morgan logger, cookieParser() etc. I tried |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
I'm a bit confused by your code snippet above. It doesn't match the text below. startStandaloneServer is for when you don't want to tweak middleware with Express. If you want to do that, use Ideally, a full reproduction (try codesandbox.io) is helpful. |
Beta Was this translation helpful? Give feedback.
Ok. I ran your code locally and logging was fine. Maybe something with codesandbox.
The reason you're seeing the repeated logs seemingly after each query is because Explorer is querying your schema every second for changes. If you close Explorer or disable schema polling you'll notice the logs stop.