Skip to content

Commit

Permalink
also send referrer through to embed, so we can grab this from our stu…
Browse files Browse the repository at this point in the history
…dio deployment logs as a second source
  • Loading branch information
mayakoneval committed Mar 8, 2023
1 parent e273eae commit 0343a50
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions packages/server/src/plugin/landingPage/default/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ function ApolloServerPluginLandingPageDefault<TContext extends BaseContext>(
): ImplicitlyInstallablePlugin<TContext> {
const version = maybeVersion ?? '_latest';
const apolloServerVersion = `@apollo/server@${packageVersion}`;
const configWithVersion = {
...config,
referrer: apolloServerVersion,
};

return {
__internal_installed_implicitly__: false,
Expand Down Expand Up @@ -133,11 +137,23 @@ function ApolloServerPluginLandingPageDefault<TContext extends BaseContext>(
}
</style>
${
config.embed
? 'graphRef' in config && config.graphRef
? getEmbeddedExplorerHTML(version, config, apolloServerVersion)
: getEmbeddedSandboxHTML(version, config, apolloServerVersion)
: getNonEmbeddedLandingPageHTML(version, config, apolloServerVersion)
configWithVersion.embed
? 'graphRef' in configWithVersion && configWithVersion.graphRef
? getEmbeddedExplorerHTML(
version,
configWithVersion,
apolloServerVersion,
)
: getEmbeddedSandboxHTML(
version,
configWithVersion,
apolloServerVersion,
)
: getNonEmbeddedLandingPageHTML(
version,
configWithVersion,
apolloServerVersion,
)
}
</div>
</body>
Expand Down

0 comments on commit 0343a50

Please sign in to comment.