On this page

Integration with Deno

GraphQL Yoga v2 documentation (superseded by v5): GraphQL Yoga provides you a cross-platform GraphQL Server. So you can easily integrate it into any platform besides Node.js.

GraphQL Yoga provides you a cross-platform GraphQL Server. So you can easily integrate it into any platform besides Node.js. Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust. But instead of graphql-yoga npm package, we will use @graphql-yoga/common which has an agnostic HTTP handler using Fetch API’s Request and Response objects.

Example

deno-example.ts
import { createServer } from 'https://cdn.skypack.dev/@graphql-yoga/common'
import { serve } from 'https://deno.land/std/http/server.ts'

const graphQLServer = createServer()

serve(graphQLServer, { port: 4000 })

console.log('Server is running on http://localhost:4000/graphql')