Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict'
const ApolloServerCore = require('apollo-server-core');
const graphql = require('./apollo-graphql');
const graphiql = require('./apollo-graphiql');
class ApolloServer extends ApolloServerCore.ApolloServerBase {
constructor (opts) {
const base = {
context: opts.context,
schema: opts.gqlSchema,
typeDefs: opts.typeDefs,
resolvers: opts.resolvers,
schemaDirectives: opts.schemaDirectives,
subscriptions: false,
uploads: false,
};
if (opts.subscriptions && opts.subscriptions.enabled) {
base.subscriptions = {
path: opts.subscriptions.path,
onConnect: opts.subscriptions.onConnect,