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
The Next.js `req` and `res` objects are passed along to the context function.
46
46
47
-
## Route Handlers (experimental)
47
+
## App Router (Route Handlers)
48
48
49
-
This integration has experimental support for Next.js' new Route Handlers feature.
49
+
This integration has experimental support for [Next.js' App Router](https://nextjs.org/docs/app/building-your-application/routing/router-handlers), which is now the stable and default project structure for Next.js.
50
50
51
-
To use this integration with Route Handlers, first opt into Next.js' beta app directory by adding the following to `next.config.js`:
51
+
Make sure you're on recent version of Next.js (13.4+), then create a new Route
52
+
Handler file, for example at `app/api/graphql/route.js`.
52
53
53
-
```js
54
-
module.exports= {
55
-
experimental: {
56
-
appDir:true,
57
-
},
58
-
};
59
-
```
54
+
This file's route handlers will be accessible at URI path `/api/graphql`.
60
55
61
-
Then create a new file at for example `app/graphql/route.js`.
62
-
This file's route handlers will be accessible at `/graphql`.
63
-
64
-
Next create an Apollo Server instance, pass it to `startServerAndCreateNextHandler` and finally pass the handler to both a GET and a POST route handler:
56
+
Next create an Apollo Server instance, pass it to `startServerAndCreateNextHandler` and
57
+
finally pass the handler to both a GET and a POST route handler:
0 commit comments