Open mdv27 opened 1 year ago
Existing function
import { AzureFunction, Context, HttpRequest } from "@azure/functions"; import { ApolloServer } from "apollo-server-azure-functions"; import { ApolloGateway } from "@apollo/gateway"; import { ApolloServerPluginLandingPageGraphQLPlayground } from 'apollo-server-core'; const startApollo = () => { let handler: AzureFunction | undefined; const init = async () => { const gateway = new ApolloGateway({ serviceList: [ { name: 'subgraph-api', url: 'https://localhost:7071/api/graphql' } ] }); const { schema, executor } = await gateway.load(); const server = new ApolloServer({ schema, executor: executor as any, plugins: [ApolloServerPluginLandingPageGraphQLPlayground]}); handler = server.createHandler() console.log("Apollo server started."); }; init(); return (context: Context, req: HttpRequest) => { if (handler) handler(context, req); }; }; exports.graphqlHandler = startApollo();
ApolloServer class in @apollo/server v4 does not support above constructor param executor. Also createHandler() not present. Please help.
ApolloServer
executor
createHandler()
Existing function
ApolloServer
class in @apollo/server v4 does not support above constructor paramexecutor
. AlsocreateHandler()
not present. Please help.