mongoose graphql shacdn next setup completed
This commit is contained in:
0
app/api/a.txt
Normal file
0
app/api/a.txt
Normal file
5
app/api/auth/[...nextauth]/route.ts
Normal file
5
app/api/auth/[...nextauth]/route.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import NextAuth from "next-auth";
|
||||
import { authOptions } from "@/lib/auth";
|
||||
|
||||
const handler = NextAuth(authOptions);
|
||||
export { handler as GET, handler as POST };
|
||||
9
app/api/graphql/route.ts
Normal file
9
app/api/graphql/route.ts
Normal 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 };
|
||||
Reference in New Issue
Block a user