/*** UTILITY ------------------------------------------ ***/ import { executeSchema, GraphQLHTTP, gql } from "./entry.ts"; 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: { version: "0.4.0" }, schema }); /*** PROGRAM ------------------------------------------ ***/ Deno.serve({ port: 4000 }, handler); /*** deno run -A example.ts ***/