Customize the production landing page

This commit is contained in:
Trevor Blades
2022-02-11 11:57:24 -08:00
parent c2ef34fcbe
commit 619fd46696

View File

@@ -1,4 +1,5 @@
import {ApolloServer, gql} from 'apollo-server';
import {ApolloServerPluginLandingPageProductionDefault} from 'apollo-server-core';
import {buildSubgraphSchema} from '@apollo/subgraph';
import {readFileSync} from 'fs';
import {resolvers} from './resolvers.js';
@@ -7,7 +8,13 @@ const typeDefs = gql(readFileSync('./schema.graphql', 'utf-8'));
const server = new ApolloServer({
schema: buildSubgraphSchema({typeDefs, resolvers}),
introspection: true
introspection: true,
plugins: [
ApolloServerPluginLandingPageProductionDefault({
footer: false,
graphRef: process.env.APOLLO_GRAPH_REF
})
]
});
server.listen({port: process.env.PORT || 4000}).then(({url}) => {