I'm using graphql pothos ^3.30.0 to build my graphql apis (apollo server) in nextjs ^13.4.19. I recently updated nextjs and now i'm getting warnings for all of my endpoints which previously worked:
API handler should not return a value, received object.
What am i supposed to do?
This is an example of my builders:
builder.queryField('getClientsList', (t) =>
t.prismaField({
type: ['Client'],
resolve: async (query, _parent, _args, _info) =>
prisma.client.findMany({
...query,
})
})
)
export const schema = builder.toSchema()
this is my graphql endpoint using the old pages api (i'm using both App router and pages api for legacy stuff that i don't have time to troubleshoot)
import {schema} from "@/pages/api/schema";
import {ApolloServer} from "@apollo/server";
import {startServerAndCreateNextHandler} from "@as-integrations/next";
import {ApolloServerPluginLandingPageDisabled} from "@apollo/server/plugin/disabled";
export const dynamic = true;
const server = new ApolloServer({
schema,
introspection: process.env.NODE_ENV === 'development',
plugins: process.env.NODE_ENV === 'development' ? [] : [ApolloServerPluginLandingPageDisabled()],
});
export default startServerAndCreateNextHandler(server, {
context: async (req, res) => ({req, res}),
});