mongoose graphql shacdn next setup completed

This commit is contained in:
2025-11-13 15:42:26 +03:00
parent a5bdcb9705
commit 053586c5cc
34 changed files with 9309 additions and 2 deletions

9
app/api/graphql/route.ts Normal file
View File

@@ -0,0 +1,9 @@
import { ApolloServer } from '@apollo/server';
import { startServerAndCreateNextHandler } from '@as-integrations/next';
import { NextRequest } from 'next/server';
import { typeDefs, resolvers } from '@/graphql';
const server = new ApolloServer({ typeDefs, resolvers, introspection: process.env.NODE_ENV === 'development' });
const handler = startServerAndCreateNextHandler(server, { context: async (req: NextRequest) => ({ req }) });
export { handler as GET, handler as POST };