GQLoom

Yoga

GraphQL Yoga is a batteries-included cross-platform GraphQL over HTTP spec-compliant GraphQL server powered by Envelop and GraphQL Tools that runs anywhere; focused on easy setup, performance and great developer experience.

Installation

npm i graphql graphql-yoga @gqloom/core

Usage

import {  } from "@gqloom/core"
import {  } from "node:http"
import {  } from "graphql-yoga"
import {  } from "./resolvers"
 
const  = ()
 
const  = ({  })
 
().(4000, () => {
  .("Server is running on http://localhost:4000/graphql")
})

Contexts

When using GQLoom together with Yoga, you can use YogaInitialContext to label the type of context:

import {  } from "@gqloom/core"
import { type YogaInitialContext } from "graphql-yoga"
 
export function () {
  return <YogaInitialContext>()...("Authorization")
}

You can also learn more about contexts in the Yoga documentation.

On this page