Commit 7053aeae authored by Jure's avatar Jure

Merge branch 'add-config-to-apollo' into 'master'

feat: use a config object with apollo's config

See merge request !562
parents c8ffb021 5135db61
Pipeline #12995 passed with stages
in 14 minutes and 1 second
......@@ -18,6 +18,10 @@ const hostname = config.has('pubsweet-server.hostname')
? config.get('pubsweet-server.hostname')
: 'localhost'
const extraApolloConfig = config.has('pubsweet-server.apollo')
? config.get('pubsweet-server.apollo')
: {}
const api = app => {
app.use('/graphql', authBearerAndPublic)
const server = new ApolloServer({
......@@ -56,6 +60,7 @@ const api = app => {
playground: {
subscriptionEndpoint: `ws://${hostname}:3000/subscriptions`,
},
...extraApolloConfig,
})
server.applyMiddleware({ app })
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment