0.0.0-experimental.1 • Published 1 year ago

@kingworldjs/graphql-yoga v0.0.0-experimental.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@kingworldjs/graphql-yoga

A plugin for kingworld that add support for returning html.

Installation

bun add graphql graphql-yoga@three @kingworldjs/graphql-yoga

Example

import { KingWorld } from 'kingworld'
import { yoga } from '@kingworldjs/graphql-yoga'

import { createYoga, createSchema } from 'graphql-yoga'

const app = new KingWorld()
    .use(
        yoga({
            path: "/graphql",
            yoga: createYoga({
                schema: createSchema({
                    typeDefs: `
                        type Query {
                            hi: String
                        }
                `,
                resolvers: {
                    Query: {
                        hi: () => 'Hi from KingWorld'
                    }
                }
            })
        })
    )
    .listen(8080)

path

@default "/graphql"

Path to expose as GraphQL handler

yoga

GraphQL Yoga instance