From 99ff768f05b6daff566e1f2b946bea38e276e41b Mon Sep 17 00:00:00 2001 From: v1rtl Date: Wed, 15 Mar 2023 11:57:03 +0200 Subject: [PATCH] update examples & readme --- README.md | 16 ++++++++-------- examples/oak.ts | 6 +++--- examples/opine.ts | 9 +++++---- examples/vanilla.ts | 6 +++--- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index ae2360c..1957ef2 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,10 @@ Universal [GraphQL](https://www.graphql.com/) HTTP middleware for Deno. The simplest setup with `std/http`: ```ts -import { Server } from 'https://deno.land/std@0.148.0/http/server.ts' -import { GraphQLHTTP } from '../mod.ts' -import { makeExecutableSchema } from 'https://deno.land/x/graphql_tools@0.0.2/mod.ts' -import { gql } from 'https://deno.land/x/graphql_tag@0.0.1/mod.ts' +import { Server } from 'https://deno.land/std@0.179.0/http/server.ts' +import { GraphQLHTTP } from 'https://deno.land/x/gql/mod.ts' +import { makeExecutableSchema } from 'https://esm.sh/@graphql-tools/schema@9.0.17' +import { gql } from 'https://deno.land/x/graphql_tag@0.1.1/mod.ts' const typeDefs = gql` type Query { @@ -47,12 +47,12 @@ const s = new Server({ return pathname === '/graphql' ? await GraphQLHTTP({ - schema: makeExecutableSchema({ resolvers, typeDefs }), - graphiql: true, - })(req) + schema: makeExecutableSchema({ resolvers, typeDefs }), + graphiql: true + })(req) : new Response('Not Found', { status: 404 }) }, - addr: ':3000', + addr: ':3000' }) s.listenAndServe() diff --git a/examples/oak.ts b/examples/oak.ts index 52d2f34..e350888 100644 --- a/examples/oak.ts +++ b/examples/oak.ts @@ -2,10 +2,10 @@ import { Application, Middleware, Router, -} from 'https://deno.land/x/oak@v11.1.0/mod.ts' +} from 'https://deno.land/x/oak@v12.1.0/mod.ts' import { GraphQLHTTP } from '../mod.ts' -import { makeExecutableSchema } from 'https://esm.sh/@graphql-tools/schema@9.0.16' -import { gql } from 'https://deno.land/x/graphql_tag@0.1.0/mod.ts' +import { makeExecutableSchema } from 'https://esm.sh/@graphql-tools/schema@9.0.17' +import { gql } from 'https://deno.land/x/graphql_tag@0.1.1/mod.ts' const typeDefs = gql` type Query { diff --git a/examples/opine.ts b/examples/opine.ts index bd5ad8b..7db8470 100644 --- a/examples/opine.ts +++ b/examples/opine.ts @@ -1,10 +1,11 @@ import { opine, OpineRequest } from 'https://deno.land/x/opine@2.3.3/mod.ts' import { GraphQLHTTP } from '../mod.ts' -import { makeExecutableSchema } from 'https://esm.sh/@graphql-tools/schema@9.0.16' -import { gql } from 'https://deno.land/x/graphql_tag@0.1.0/mod.ts' -import { readAll } from 'https://deno.land/std@0.177.0/streams/read_all.ts' +import { makeExecutableSchema } from 'https://esm.sh/@graphql-tools/schema@9.0.17' +import { gql } from 'https://deno.land/x/graphql_tag@0.1.1/mod.ts' +import { readAll } from 'https://deno.land/std@0.179.0/streams/read_all.ts' +import type { GraphQLParams } from '../types.ts' -type Request = OpineRequest & { json: () => Promise } +type Request = OpineRequest & { json: () => Promise } const typeDefs = gql` type Query { diff --git a/examples/vanilla.ts b/examples/vanilla.ts index cec1285..2ab1104 100644 --- a/examples/vanilla.ts +++ b/examples/vanilla.ts @@ -1,7 +1,7 @@ -import { Server } from 'https://deno.land/std@0.177.0/http/server.ts' +import { Server } from 'https://deno.land/std@0.179.0/http/server.ts' import { GraphQLHTTP } from '../mod.ts' -import { makeExecutableSchema } from 'https://esm.sh/@graphql-tools/schema@9.0.16' -import { gql } from 'https://deno.land/x/graphql_tag@0.1.0/mod.ts' +import { makeExecutableSchema } from 'https://esm.sh/@graphql-tools/schema@9.0.17' +import { gql } from 'https://deno.land/x/graphql_tag@0.1.1/mod.ts' const typeDefs = gql` type Query {