GQLoom

Mercurius

Mercurius is a GraphQL adapter for Fastify

Installation

npm i fastify mercurius graphql @gqloom/core

Usage

import {  } from "@gqloom/core"
import  from "fastify"
import  from "mercurius"
import {  } from "./resolvers"
 
const  = ()
 
const  = ()
.(, {  })
.({ : 4000 }, () => {
  .("Mercurius server is running on http://localhost:4000")
})

Contexts

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

import {  } from "@gqloom/core"
import { type MercuriusContext } from "mercurius"
 
export function () {
  return <MercuriusContext>()....
}

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

On this page