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 { ApolloServer } = require('apollo-server-hapi')
const resolvers = require('./resolvers')
const typeDefs = require('./defs')
/**
* Schema used by the Apollo GraphQL plugin for the hapi.js server.
*/
module.exports = new ApolloServer({
typeDefs,
resolvers
})
import { ApolloServer } from "apollo-server-hapi";
import { typeDefs } from "./defs";
import { resolvers } from "./resolvers";
/**
* Schema used by the Apollo GraphQL plugin for the hapi.js server.
*/
export const apolloServer = new ApolloServer({
typeDefs,
resolvers,
});
//This should be in the config
port: 8087
}
)
const schema = makeExecutableSchema(
{
typeDefs,
resolvers,
resolverValidationOptions: {
requireResolversForResolveType: false
}
}
)
const apolloServer = new ApolloServer(
{
schema,
context: {
db: prisma
}
}
)
await apolloServer.applyMiddleware({
app: api
})
await apolloServer.installSubscriptionHandlers(api.listener)
return api
}