generated from unjs/template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
let apolloServer: ApolloServer<BaseContext>
function createServer() {
const { typeDefs, resolvers: mergedResolvers } = createMergedSchema()
if (!apolloServer) {
apolloServer = new ApolloServer({
typeDefs,
resolvers: mergedResolvers,
plugins: [
ApolloServerPluginLandingPageLocalDefault({
embed: true, // Enable embedded Apollo Sandbox
}),
],
})
}
return apolloServer
}
const handler = startServerAndCreateH3Handler(createServer, {
context: async event => ({ event }),
})
export default defineEventHandler(handler)unnecessary files are placed in the build before the request. I need to add a func for this. Can you ensure this. Actually, this is how the script should be written.
No overload matches this call.
Overload 1 of 2, '(server: ApolloServer<BaseContext>, options?: H3HandlerOptions<BaseContext> | undefined): EventHandler<EventHandlerRequest, any>', gave the following error.
Argument of type '() => ApolloServer<BaseContext>' is not assignable to parameter of type 'ApolloServer<BaseContext>'.
Overload 2 of 2, '(server: ApolloServer<BaseContext>, options: WithRequired<H3HandlerOptions<BaseContext>, "context">): EventHandler<...>', gave the following error.
Argument of type '() => ApolloServer<BaseContext>' is not assignable to parameter of type 'ApolloServer<BaseContext>'.ts(2769)
Metadata
Metadata
Assignees
Labels
No labels