From 52ba983d90443d4bc79dd48a0858611ffb47ea96 Mon Sep 17 00:00:00 2001 From: v1rtl Date: Wed, 24 Mar 2021 00:13:55 +0300 Subject: [PATCH] minor adjustments --- README.md | 5 +++-- examples/tinyhttp.ts | 1 + examples/vanilla.ts | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6f77611..71b3b76 100644 --- a/README.md +++ b/README.md @@ -34,12 +34,13 @@ type Query { const s = serve({ port: 3000 }) for await (const req of s) { - req.url === '/graphql' + req.url.startsWith('/graphql') ? await GraphQLHTTP({ schema, rootValue: { hello: () => 'Hello World!' - } + }, + graphiql: true })(req) : req.respond({ status: 404 diff --git a/examples/tinyhttp.ts b/examples/tinyhttp.ts index 2562eec..c63131a 100644 --- a/examples/tinyhttp.ts +++ b/examples/tinyhttp.ts @@ -15,6 +15,7 @@ app '/graphql', GraphQLHTTP({ schema, + graphiql: true, rootValue: { hello: () => 'Hello World!' } diff --git a/examples/vanilla.ts b/examples/vanilla.ts index 1e0a756..9949a15 100644 --- a/examples/vanilla.ts +++ b/examples/vanilla.ts @@ -11,12 +11,13 @@ type Query { const s = serve({ port: 3000 }) for await (const req of s) { - req.url === '/graphql' + req.url.startsWith('/graphql') ? await GraphQLHTTP({ schema, rootValue: { hello: () => 'Hello World!' - } + }, + graphiql: true })(req) : req.respond({ status: 404