Skip to content

SaltyAom/kingworld-graphql-jit

Repository files navigation

@kingworldjs/graphql-jit

An experimental plugin for kingworld that adds support for using GraphQL JIT.

EXPERIMENTAL: DO NOT USE

Installation

bun add graphql @kingworldjs/graphql-jit

Example

import { KingWorld } from 'kingworld'
import { graphql } from '../src'

const app = new KingWorld()
    .get('/', () => 'Hi')
    .post('/mirror', (context) => context.body)
    .use(graphql, {
        resolvers: {
            Query: {
                hello: () => 'Hello world!'
            }
        },
        schema: `
            type Query {
                hello: String
            }`
    })
    .listen(8080)

path

@default "/graphql"

Path to expose as GraphQL handler

schema

GraphQL schema

resolvers

Resolvers funcitons

resolvers: {
    Query?: Record<string, Function | Promise<Function>>
    Mutation?: Record<string, Function | Promise<Function>>
    Subscription?: Record<string, Function | Promise<Function>>
}

About

An experimental plugin for KingWorld that adds support for using GraphQL JIT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages