ESTE ES MI API/GRAPHQL
import { ApolloServer } from '@apollo/server';
import { startServerAndCreateNextHandler } from '@as-integrations/next';
import { schema } from '../../server/nexusSchema';
import { createContext } from '../../server/context';
import { NextApiRequest, NextApiResponse } from 'next';
import { ApolloServerPluginLandingPageDisabled } from '@apollo/server/plugin/disabled';
import { ApolloServerPluginLandingPageGraphQLPlayground } from '@apollo/server-plugin-landing-page-graphql-playground';
type NextApi = {
req: NextApiRequest;
res: NextApiResponse;
};
https://paneldeusuario.vercel.app/api/graphql CUANDO LO SUBO A VERCEL ME DA ESTE ERROR EN MI API
http://localhost:3000/api/graphql EN LOCALHOST FUNCIONA BIEN
https://paneldeusuario.vercel.app/admin/models/User ME DA ERROR DE SERVIDOR NO ME MUESTRA LOS DATOS SERVER STATUS OF 400 ERROR DE API![Captura de pantalla (546)](https://user-images.githubusercontent.com/67123054/209000899-621af5b7-3652-4c1a-9327-c741896e76a5.png)
ESTE ES MI API/GRAPHQL import { ApolloServer } from '@apollo/server'; import { startServerAndCreateNextHandler } from '@as-integrations/next'; import { schema } from '../../server/nexusSchema'; import { createContext } from '../../server/context'; import { NextApiRequest, NextApiResponse } from 'next'; import { ApolloServerPluginLandingPageDisabled } from '@apollo/server/plugin/disabled'; import { ApolloServerPluginLandingPageGraphQLPlayground } from '@apollo/server-plugin-landing-page-graphql-playground';
type NextApi = { req: NextApiRequest; res: NextApiResponse; };
const apolloServer = new ApolloServer({
schema,
plugins: [
process.env.NODE_ENV === 'production'
? ApolloServerPluginLandingPageDisabled()
: ApolloServerPluginLandingPageGraphQLPlayground(),
],
});
export default startServerAndCreateNextHandler(apolloServer, { context: createContext, });