File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
packages/web/docs/src/content/gateway/deployment/node-frameworks Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -14,21 +14,18 @@ Hive Gateway can be integrated with Next.js easily as
1414
1515## Example
1616
17- ``` ts
18- // Next.js Custom Route Handler: https://nextjs.org/docs/app/building-your-application/routing/router-handlers
17+ Please read the
18+ [ relevant Next.js documentation on custom router handlers] ( https://nextjs.org/docs/app/building-your-application/routing/router-handlers )
19+ first.
1920
21+ ``` ts filename="app/api/route.ts"
2022import { createGatewayRuntime } from ' @graphql-hive/gateway-runtime'
23+ import { supergraph } from ' ./my-supergraph'
2124
2225const { handleRequest } = createGatewayRuntime ({
23- /* Your configuration here before the following required settings */
24-
25- // While using Next.js file convention for routing, we need to configure Hive Gateway to use the correct endpoint
26- graphqlEndpoint: ' /api/graphql' ,
27-
28- // Hive Gateway needs to know how to create a valid Next response
29- fetchAPI: { Response }
26+ supergraph ,
27+ graphqlEndpoint: ' /api/graphql'
3028})
3129
32- // Export the handler to be used with the following HTTP methods
3330export { handleRequest as GET , handleRequest as POST , handleRequest as OPTIONS }
3431```
You can’t perform that action at this time.
0 commit comments