import { server } from 'nexus'

Guideissues (features | bugs)

The Server component is designed for managing the HTTP network layer that enables clients to actually send over GraphQL operations for your app to execute. If you are new to this component then you may be interested in our server guide.

express

Gives you access to the underlying express instance.

Use this to add middlewares or expose additional endpoints if needed.

Example of using middlewares

1import something from 'some-express-middleware'
2import { server } from 'nexus'
3
4server.express.use(something())

raw.http

The underlying Node HTTP Server instance.

Access to this is made available mostly as an escape hatch, and maybe a few valid advanced use-cases. If you haven't already/are not sure, consider opening an issue for your use-case. Maybe Nexus can and should provide better first-class support for what you are trying to do!

Edit this page on Github