@kingworldjs/graphql-yoga
v0.0.0-experimental.1
Published
A plugin for kingworld for using graphql-yoga
Downloads
3
Readme
@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