the-road-to-graphql / fullstack-apollo-express-mongodb-boilerplate

💥A sophisticated GraphQL with Apollo, Express and MongoDB boilerplate project.
https://www.robinwieruch.de
MIT License
337 stars 104 forks source link

Connection in Context #6

Closed ghost closed 5 years ago

ghost commented 5 years ago

Could you help me understand the following snippet:

context: async ({ req, connection }) => { if (connection) {...{...

How does connection get into the request? Without this the API always throws an authentication error.

Thanks!