Update middleware to match apollo-upload-server readme instructions.

This commit is contained in:
Jayden Seric 2017-11-18 19:56:56 +11:00
parent 2cf16a48af
commit a7cf818e15

View File

@ -17,12 +17,11 @@ server
.use(cors()) .use(cors())
// Enable gzip // Enable gzip
.use(compress()) .use(compress())
// Parse body
.use(koaBody())
// GraphQL API // GraphQL API
router.post( router.post(
'/graphql', '/graphql',
koaBody(),
apolloUploadServer.apolloUploadKoa({ uploadDir: './uploads' }), apolloUploadServer.apolloUploadKoa({ uploadDir: './uploads' }),
graphqlServerKoa.graphqlKoa({ graphqlServerKoa.graphqlKoa({
schema: graphqlTools.makeExecutableSchema({ typeDefs: [types], resolvers }) schema: graphqlTools.makeExecutableSchema({ typeDefs: [types], resolvers })