From 830d42f5f72bc3da4dd14ef07a7ad1f9519185b2 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 19 May 2017 19:50:05 +0200 Subject: [PATCH] Ordering of express app middleware Otherwise requests to graphiql snag on the graphql server. --- server/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/index.js b/server/index.js index 51dfb46..f3189b7 100644 --- a/server/index.js +++ b/server/index.js @@ -13,14 +13,14 @@ const GRAPHIQL_PATH = '/graphiql'; const app = express(); -// Set up the GraphQL endpoint -app.use(GRAPHQL_PATH, bodyParser.json(), graphqlExpress({ schema })); - // Set up GraphiQL app.use(GRAPHIQL_PATH, graphiqlExpress({ endpointURL: GRAPHQL_PATH, })); +// Set up the GraphQL endpoint +app.use(GRAPHQL_PATH, bodyParser.json(), graphqlExpress({ schema })); + app.listen(PORT); console.log(`GraphQL server started, listening at http://localhost:${PORT}${GRAPHQL_PATH}`);