Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { ApolloServer } from 'apollo-server-express';
import cookieParser from 'cookie-parser';
import express from 'express';
import hopsConfig from 'hops-config';
// eslint-disable-next-line node/no-extraneous-import
import schema from 'hops-graphql/schema';
const apolloAppPromise = Promise.resolve(
typeof schema === 'function' ? schema() : schema
).then(resolvedSchema => {
const app = express();
app.use(cookieParser());
const server = new ApolloServer({
schema: resolvedSchema,
playground: {
settings: {
'request.credentials': 'same-origin',
},
},
context: context => ({ ...context, config: hopsConfig }),
});
server.applyMiddleware({
app,