Skip to content

Commit

Permalink
Fix GraphQL Yoga docs example (#2485)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidsi authored Apr 24, 2024
1 parent 4505a05 commit 860877b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions website/src/pages/docs/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,18 @@ Your GraphQL `Application` exposes `createExecution` and `createSubscription` me
If you are using [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server), you can use [`useGraphQLModules`](https://envelop.dev/plugins/use-graphql-modules) plugin from Envelop.

```ts
import { createServer } from '@graphql-yoga/node'
import { createServer } from "node:http"
import { createYoga } from "graphql-yoga"
import { useGraphQLModules } from '@envelop/graphql-modules'
import { application } from './application'

const server = createServer({
plugins: [useGraphQLModules(application)]
const yoga = createYoga({
plugins: [useGraphQLModules(application)],
})

server.start().then(() => {
const server = createServer(yoga)

server.listen(4000, () => {
console.log(`🚀 Server ready`)
})
```
Expand Down

0 comments on commit 860877b

Please sign in to comment.