Skip to content
Snippets Groups Projects
graphqlApi.js 300 B
Newer Older
const createGraphQLServer = require('./graphqlServer')

const api = app => {
  app.use(
    '/graphql',
    app.locals.passport.authenticate(['bearer', 'anonymous'], {
      session: false,
    }),
  )

  const server = createGraphQLServer()
  server.applyMiddleware({ app })
}

module.exports = api