aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--deno.json2
-rw-r--r--example.ts4
-rw-r--r--remote-example.ts30
3 files changed, 33 insertions, 3 deletions
diff --git a/deno.json b/deno.json
index 8b1c4de..0bc7997 100644
--- a/deno.json
+++ b/deno.json
@@ -10,5 +10,5 @@
},
"license": "MIT",
"name": "@eol/gq",
- "version": "0.4.0"
+ "version": "0.4.1"
}
diff --git a/example.ts b/example.ts
index 9364fe0..bf0dd6b 100644
--- a/example.ts
+++ b/example.ts
@@ -3,7 +3,7 @@
/*** UTILITY ------------------------------------------ ***/
-import { executeSchema, GraphQLHTTP, gql } from "./entry.ts";
+import { executeSchema, gql, GraphQLHTTP } from "./entry.ts";
const schema = executeSchema({
resolvers: {
@@ -16,7 +16,7 @@ const schema = executeSchema({
const handler = GraphQLHTTP({
graphiql: true,
- playgroundOptions: { version: "0.4.0" },
+ playgroundOptions: { title: "Your GraphQL Server" },
schema
});
diff --git a/remote-example.ts b/remote-example.ts
new file mode 100644
index 0000000..e991453
--- /dev/null
+++ b/remote-example.ts
@@ -0,0 +1,30 @@
+
+
+
+/*** UTILITY ------------------------------------------ ***/
+
+// deno-lint-ignore-file no-import-prefix
+import { executeSchema, gql, GraphQLHTTP } from "jsr:@eol/gq";
+
+const schema = executeSchema({
+ resolvers: {
+ Query: {
+ hello: (_: unknown, { name }: { name?: string }) => `hello, ${name ?? "world"}`
+ }
+ },
+ typeDefs: gql`type Query { hello(name: String): String }`
+});
+
+const handler = GraphQLHTTP({
+ graphiql: true,
+ playgroundOptions: { title: "Neat GraphQL Server" },
+ schema
+});
+
+/*** PROGRAM ------------------------------------------ ***/
+
+Deno.serve({ port: 4000 }, handler);
+
+
+
+/*** deno run -A /http/path/to/remote-example.ts ***/