-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
next.js 15 build error #3454
Comments
This worked for me: import { createSchema, createYoga } from 'graphql-yoga';
const { handleRequest } = createYoga({
schema: createSchema({
typeDefs: /* GraphQL */ `
type Query {
greetings: String
}
`,
resolvers: {
Query: {
greetings: () => 'This is the `greetings` field of the root `Query` type'
}
}
}),
graphqlEndpoint: '/api/graphql',
fetchAPI: { Response }
});
// 👇 Manually set the `ctx` param (the second parameter in `handleRequest`)
export const GET = (req: Request) => handleRequest(req, {});
export const POST = (req: Request) => handleRequest(req, {});
export const OPTIONS = (req: Request) => handleRequest(req, {});
// 👇 this syntax produces a build error during `next build` (as of Next.js 15.0.2)
// export { handleRequest as GET, handleRequest as POST, handleRequest as OPTIONS } Gotta love Next.js sometimes... |
@nick-cheatwood7 Could you help us updating the documentation for this? |
@n1ru4l Yes, I'd be happy to. I don't have prior experience with contributing to this documentation, though. Is there a guide on how to do so or anything? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Error log
Your Example Website or App
not
Steps to Reproduce the Bug or Issue
nextjs 15
https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-nextjs
Expected behavior
No error
Screenshots or Videos
Platform
@graphql-yoga/*
version(s):5.8.0Additional context
No response
The text was updated successfully, but these errors were encountered: