Skip to content

Commit

Permalink
Merge pull request #459 from bwlt/fix/graphiql
Browse files Browse the repository at this point in the history
Using await on graphiql handler - Fix graphiql issues
  • Loading branch information
Sashko Stubailo authored Jul 13, 2017
2 parents 5ea2169 + 525f40a commit f20161b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions packages/graphql-server-micro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ const server = micro(
get("/graphql", graphqlHandler),
post("/graphql", graphqlHandler),
get("/graphiql", graphiqlHandler),
get("/noop", (req, res) => {
// Micro router requires at least one 200 route
// or you will always get a 404
return send(res, 200, "");
}),

(req, res) => send(res, 404, "not found"),
),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-server-micro/src/microApollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface MicroGraphiQLOptionsFunction {
export function microGraphiql(options: GraphiQL.GraphiQLData | MicroGraphiQLOptionsFunction): RequestHandler {
return (req: IncomingMessage, res: ServerResponse) => {
const query = req.url && url.parse(req.url, true).query || {};
GraphiQL.resolveGraphiQLString(query, options, req).then(graphiqlString => {
return GraphiQL.resolveGraphiQLString(query, options, req).then(graphiqlString => {
res.setHeader('Content-Type', 'text/html');
res.write(graphiqlString);
res.end();
Expand Down

0 comments on commit f20161b

Please sign in to comment.