1.0.3 • Published 1 month ago

@elysiajs/apollo v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@elysiajs/apollo

Plugin for elysia for using GraphQL Apollo.

Installation

bun add @elysiajs/apollo @apollo/server graphql

Example

import { Elysia } from 'elysia'
import { apollo, gql } from '@elysiajs/apollo'

const app = new Elysia()
    .use(
        apollo({
            typeDefs: gql`
                type Book {
                    title: String
                    author: String
                }

                type Query {
                    books: [Book]
                }
            `,
            resolvers: {
                Query: {
                    books: () => {
                        return [
                            {
                                title: 'Elysia',
                                author: 'saltyAom'
                            }
                        ]
                    }
                }
            }
        })
    )
    .listen(8080)

Config

This plugin extends Apollo's ServerRegistration (which is ApolloServer's' constructor parameter).

Below are the extended parameters for configuring Apollo Server with Elysia.

path

@default "/graphql"

Path to expose Apollo Server

enablePlayground

@default "process.env.ENV !== 'production'

Determine whether should Apollo should provide Apollo Playground

1.0.3

1 month ago

1.0.2

2 months ago

1.0.0

2 months ago

1.0.0-rc.0

2 months ago

1.0.0-beta.1

3 months ago

1.0.0-beta.0

3 months ago

0.8.0

5 months ago

0.8.0-rc.0

5 months ago

0.7.0-beta.0

8 months ago

0.7.0

8 months ago

0.6.0-rc.0

9 months ago

0.6.0

9 months ago

0.5.0-rc.1

12 months ago

0.3.0

1 year ago

0.3.0-rc.0

1 year ago

0.5.0

12 months ago

0.4.1

1 year ago

0.5.2

11 months ago

0.5.0-rc.0

12 months ago

0.4.3

1 year ago

0.5.1

11 months ago

0.4.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.0-rc.0

1 year ago

0.1.0-beta.0

1 year ago