import { graphqlCloudflare } from './cloudflareApollo' ; import { ApolloServerBase } from 'apollo-server-core' ; export { GraphQLOptions } from 'apollo-server-core' ; import type { GraphQLOptions } from 'apollo-server-core' ; import type { Request } from 'apollo-server-env' ; export class ApolloServer extends ApolloServerBase { async createGraphQLServerOptions ( request ) { return super . graphQLServerOptions ( { request } ) ; } public async listen ( ) { this . assertStarted ( 'listen' ) ; addEventListener ( 'fetch' , ( event ) => { event . respondWith ( graphqlCloudflare ( ( ) => { return this . createGraphQLServerOptions ( event . request ) ; } ) ( event . request ) ) ; } ) ; return await { url : '' , port : null } ; } }