Skip to content

Commit

Permalink
chore: upgrade to apollo-server-express 3.x (#7210)
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea committed Jul 5, 2022
1 parent beffe8a commit 23fa20f
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/@vue/cli-ui/graphql-server.js
Expand Up @@ -19,7 +19,7 @@ function autoCall (fn, ...context) {
return fn
}

module.exports = (options, cb = null) => {
module.exports = async (options, cb = null) => {
// Default options
options = merge({
integratedEngine: false
Expand Down Expand Up @@ -146,6 +146,7 @@ module.exports = (options, cb = null) => {

// Apollo Server
const server = new ApolloServer(apolloServerOptions)
await server.start()

// Express middleware
server.applyMiddleware({
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/package.json
Expand Up @@ -37,7 +37,7 @@
"@achrinza/node-ipc": "^9.2.5",
"@akryum/winattr": "^3.0.0",
"@vue/cli-shared-utils": "^5.0.6",
"apollo-server-express": "^2.21.0",
"apollo-server-express": "^3.9.0",
"clone": "^2.1.1",
"deepmerge": "^4.2.2",
"express": "^4.17.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/ui.js
Expand Up @@ -68,7 +68,7 @@ async function ui (options = {}, context = process.cwd()) {
}
}

const { httpServer } = server(opts, () => {
const { httpServer } = await server(opts, () => {
// Reset for yarn/npm to work correctly
if (typeof nodeEnv === 'undefined') {
delete process.env.NODE_ENV
Expand Down

0 comments on commit 23fa20f

Please sign in to comment.