@kingworldjs/graphql-jit
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-experimental.0 • Public • Published

@kingworldjs/graphql-jit

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

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>>
}

Readme

Keywords

Package Sidebar

Install

npm i @kingworldjs/graphql-jit

Weekly Downloads

1

Version

0.0.0-experimental.0

License

MIT

Unpacked Size

710 kB

Total Files

81

Last publish

Collaborators

  • aomkirby123