@elysia/graphql-yoga
v1.4.1
Published
Elysia plugin to integrate GraphQL Yoga
Readme
@elysia/graphql-yoga
Elysia plugin to integrate GraphQL Yoga.
Installation
bun add @elysiajs/graphql-yogaExample
import { Elysia } from 'elysia'
import { yoga } from '@elysiajs/graphql-yoga'
const app = new Elysia()
.use(
yoga({
typeDefs: /* GraphQL */ `
type Query {
hi: String
}
`,
resolvers: {
Query: {
hi: () => 'Hello from Elysia'
}
}
})
)
.listen(3000)Accessing /graphql in the browser (GET request) would show you a GraphiQL instance for the GraphQL-enabled Elysia server.
Optionally, you can install a custom version of optional peer dependencies as well:
bun add graphql graphql-yoga