createServer: (httpServer) => {
const cache = new ServerCache();
const plugins = [
responseCachePlugin.default({
sessionId: sessionIdFromRequest,
extraCacheKeyData: extraCacheKeyDataFromRequest,
}),
// Enables cache control, default max age to 300 seconds
ApolloServerPluginCacheControl({ defaultMaxAge: 300 }),
....
return new ApolloServer({
typeDefs: gql${schema}
,
resolvers,
…
)}