Skip to content

Yoga options does not accept schema or yoga property #3

Open
@arkmech

Description

@arkmech

Example from: https://www.npmjs.com/package/@elysiajs/graphql-yoga

import { Elysia } from 'elysia'
import { yoga } from '@elysiajs/graphql-yoga'

import { createYoga, createSchema } from 'graphql-yoga'

const app = new Elysia()
    .use(
        yoga({
           // yoga property doesn't exist
            yoga: createYoga({
                schema: createSchema({
                    typeDefs: `
                        type Query {
                            hi: String
                        }
                `,
                resolvers: {
                    Query: {
                        hi: () => 'Hi from Elysia'
                    }
                }
            })
        })
    )
    .listen(8080)

Error

Object literal may only specify known properties, and 'yoga' does not exist in type 'ElysiaYogaConfig<string, MaybePromise<Record<string, unknown>> | ((initialContext: YogaInitialContext) => unknown) | undefined>'

Desired, yoga accepts schema property createSchema() or from makeExecutableSchema(), can only do typeDefs and resolvers separately.

  app.use(yoga({ schema }));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions