GraphQL Yoga v2 documentation (superseded by v5): Expressis the most popular web framework for Node.js. It is a minimalist framework that provides a robust set of features to handle HTTP on Node.js applications.
Express is the most popular web framework for Node.js. It is a minimalist
framework that provides a robust set of features to handle HTTP on Node.js applications. You can
easily integrate GraphQL Yoga into your Express application with a few lines of code.
Installation
npm i @graphql-yoga/node express graphql
yarn add @graphql-yoga/node express graphql
pnpm add @graphql-yoga/node express graphql
bun add @graphql-yoga/node express graphql
Example
import express from 'express'import { createServer } from '@graphql-yoga/node'const app = express()const graphQLServer = createServer()// Bind GraphQL Yoga to `/graphql` endpointapp.use('/graphql', graphQLServer)app.listen(4000, () => { console.log('Running a GraphQL API server at http://localhost:4000/graphql')})
This site uses cookies for analytics and improving your experience.