You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
progresses #782closes#528
#### Implementation Notes
Several deps have been added in this PR. The goal is to move quickly and iterate on our server components. None of the deps are large, even [fp-ts](https://bundlephobia.com/[email protected]).
fp-ts is exciting. It begins our journey into throw-free code!
#### User Notes
This feature will remain undocumented while we make progress on more parts around it.
This feature exposes request handlers on the server component.
```ts
import { server } from 'nexus'
server.handlers.graphql
server.handlers.playground
```
Users can use these to response to requests in a serverless environment.
```ts
import { server } from 'nexus'
export default (req, res) => {
server.handlers.graphql(req, res)
}
```
- Nexus has experimental support for serverless deployments.
2
+
- Support for serverless is being tracked in [#782](https://github.com./graphql-nexus/nexus/issues/782).
3
+
- Serverless features are not yet documented in the API docs.
4
+
- The server component of Nexus exposes HTTP request handlers.
5
+
6
+
```ts
7
+
import { server } from'nexus'
8
+
9
+
server.handlers.graphql// call with (req, res)
10
+
server.handlers.playground// call with (req, res)
11
+
```
12
+
13
+
- Use these to handle to requests in your serverless environment.
14
+
15
+
```ts
16
+
import { server } from'nexus'
17
+
18
+
exportdefault (req, res) => {
19
+
server.handlers.graphql(req, res)
20
+
}
21
+
```
22
+
23
+
- See the [Next.JS example](https://github.com./graphql-nexus/examples/tree/master/integration-nextjs) for a functioning serverless reference.
0 commit comments