embed graphql sandbox

This commit is contained in:
keyan 2023-11-21 16:46:03 -06:00
parent 70e4b27c03
commit 4a35c13ff3
1 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,10 @@ import typeDefs from '../../api/typeDefs'
import { getServerSession } from 'next-auth/next'
import { getAuthOptions } from './auth/[...nextauth]'
import search from '../../api/search'
import {
ApolloServerPluginLandingPageLocalDefault,
ApolloServerPluginLandingPageProductionDefault
} from '@apollo/server/plugin/landingPage/default'
const apolloServer = new ApolloServer({
typeDefs,
@ -38,7 +42,12 @@ const apolloServer = new ApolloServer({
}
}
}
}]
},
process.env.NODE_ENV === 'production'
? ApolloServerPluginLandingPageProductionDefault(
{ embed: { endpointIsEditable: false, persistExplorerState: true, displayOptions: { theme: 'dark' } }, footer: false })
: ApolloServerPluginLandingPageLocalDefault(
{ embed: { endpointIsEditable: false, persistExplorerState: true, displayOptions: { theme: 'dark' } }, footer: false })]
})
export default startServerAndCreateNextHandler(apolloServer, {