A plugin for kingworld that add support for returning html.
bun add graphql graphql-yoga@three @kingworldjs/graphql-yoga
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)
@default "/graphql"
Path to expose as GraphQL handler
GraphQL Yoga instance