import { ApolloServer } from '@apollo/server';
import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
import { enableIntrospection } from '../config.js';
const buildApolloServer = (configOverride, { httpServer, serverCleanup }) => new ApolloServer({
    csrfPrevention: true,
    cache: 'bounded',
    plugins: [
        ApolloServerPluginDrainHttpServer({ httpServer }),
        {
            async serverWillStart() {
                return {
                    async drainServer() {
                        await serverCleanup.dispose();
                    },
                };
            },
        }
    ],
    introspection: enableIntrospection,
    ...configOverride,
});
export default buildApolloServer;
//# sourceMappingURL=index.js.map