elysiajs / elysia-graphql-yoga

Plugin for Elysia for using graphql-yoga
MIT License
8 stars 5 forks source link

feat[schema-prop]: adds schema as prop that can passed to yoga({}) #8

Closed renhyl closed 6 months ago

renhyl commented 8 months ago

we can pass schema prop to yoga({ schema })

import { Elysia } from 'elysia'
import { yoga, createSchema } from '@elysiajs/graphql-yoga'
const { loadFiles } = require('@graphql-tools/load-files')

const schema = createSchema({
 typeDefs: await loadFiles('src/typeDefs/**/*.graphql')
 resolvers: await loadFiles('src/resolvers/**/*.{js,ts}')
})
 *
const app = new Elysia()
    .use(
        yoga({
            schema
        })
    )
    .listen(8080)

this resolves issue: https://github.com/elysiajs/elysia-graphql-yoga/issues/3

qlaffont commented 7 months ago

any update on this one ? @SaltyAom

qlaffont commented 7 months ago

To start working with it, I have published the npm package (with the source code of this pr) : elysia-graphql-yoga-schema

qlaffont commented 6 months ago

Update Salty is on holiday so we need to wait.

qlaffont commented 6 months ago

any update @SaltyAom ?