Skip to content

Commit

Permalink
Fix integration-with-sveltekit.mdx (#2927)
Browse files Browse the repository at this point in the history
Updates the documentation to correctly show the needed values to make this work on SvelteKit
  • Loading branch information
half2me committed Aug 4, 2023
1 parent 126e72d commit c29af1d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ npm i graphql-yoga graphql

### Create your graphql endpoint

Create the file `src/routes/api/graphql.ts`:
Create the file `src/routes/api/graphql/+server.ts`:

```ts filename="src/routes/api/graphql.ts"
```ts filename="src/routes/api/graphql/+server.ts"
import { createSchema, createYoga } from 'graphql-yoga'
import type { RequestEvent } from '@sveltejs/kit'

Expand All @@ -50,7 +50,7 @@ const yogaApp = createYoga<RequestEvent>({
fetchAPI: globalThis
})

export { yogaApp as get, yogaApp as post }
export { yogaApp as GET, yogaApp as POST }
```

> **Simple example** on our GitHub repository
Expand Down

0 comments on commit c29af1d

Please sign in to comment.