Skip to Content

Integration with Next.js

Next.js is a web framework that allows you to build websites very quickly and Hive Gateway can be integrated with Next.js easily as a custom route handler.

Example

Please read the relevant Next.js documentation on custom router handlers first.

app/api/route.ts
import { createGatewayRuntime } from '@graphql-hive/gateway-runtime' import { supergraph } from './my-supergraph' const { handleRequest } = createGatewayRuntime({ supergraph, graphqlEndpoint: '/api/graphql' }) export { handleRequest as GET, handleRequest as POST, handleRequest as OPTIONS }
Last updated on