Skip to content

Commit

Permalink
Merge pull request #299 from hyper63/fix/app-opine-graphql-route
Browse files Browse the repository at this point in the history
fix(app-opine): regression with graphql route
  • Loading branch information
TillaTheHun0 committed Aug 26, 2021
2 parents 6211994 + 64cff61 commit 6ffa716
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/app-opine/mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default function (services) {
app.use(hyperRouter(services));
// GQL
app.use(
"/graphql",
hyperGqlRouter({
playground: (playground && playground !== "false") ||
env !== "production",
Expand Down
1 change: 0 additions & 1 deletion packages/app-opine/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export function hyperRouter(services) {
app.delete("/crawler/:bucket/:name", bindCore, crawler.del);

app.get("/error", (_req, _res, next) => {
console.log("oooooo");
next(new Error("Error occuried"));
});

Expand Down
7 changes: 7 additions & 0 deletions packages/app-opine/test/mod_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ Deno.test("GET /", async () => {

assertEquals(res.body.name, "hyper63");
});

Deno.test("GET /graphql", async () => {
await superdeno(app)
.get("/graphql")
.set("Accept", "text/html") // ask for the playground
.expect(200);
});

0 comments on commit 6ffa716

Please sign in to comment.