Skip to content

Commit 00d7a35

Browse files
ardatanijjk
andauthored
Use the stable GraphQL Yoga v3 in the GraphQL example (vercel#44488)
Use the stable GraphQL Yoga v3 in the GraphQL example, and also disable body parser for fully functionality as in GraphQL Yoga's recipe for Next.js; https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-nextjs#example Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
1 parent 3dfb85d commit 00d7a35

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

examples/api-routes-graphql/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"start": "next start"
77
},
88
"dependencies": {
9-
"graphql-yoga": "three",
9+
"graphql-yoga": "^3.2.1",
1010
"graphql": "^16.5.0",
1111
"next": "latest",
1212
"react": "^18.2.0",

examples/api-routes-graphql/pages/api/graphql.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ const schema = createSchema({
2222
resolvers,
2323
})
2424

25+
export const config = {
26+
api: {
27+
// Disable body parsing (required for file uploads)
28+
bodyParser: false,
29+
},
30+
}
31+
2532
export default createYoga({
2633
schema,
2734
// Needed to be defined explicitly because our endpoint lives at a different path other than `/graphql`

0 commit comments

Comments
 (0)