Created
January 4, 2024 17:35
-
-
Save patrickisgreat/a07b504a3e867a9edff6f122e3810947 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addConditionalPlugins(plugins) { | |
const config = AppConfig.get(); | |
if (config.responseCacheEnabled) { | |
plugins.push( | |
responseCachePlugin({ | |
sessionId: async (requestContext) => | |
requestContext.request.http?.headers.get("sc-user") ?? null, | |
}) | |
); | |
} | |
if (config.nodeEnv === "production") { | |
plugins.push(ApolloServerPluginLandingPageDisabled()); | |
} else { | |
plugins.push(ApolloServerPluginLandingPageLocalDefault({ embed: true })); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment