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

0.0.0-experimental.1 • Public • Published

@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

Readme

Keywords

Package Sidebar

Install

npm i @kingworldjs/graphql-yoga

Weekly Downloads

1

Version

0.0.0-experimental.1

License

MIT

Unpacked Size

17.1 kB

Total Files

11

Last publish

Collaborators

  • aomkirby123