-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move to JSR, use superfetch in tests, update examples
- Loading branch information
1 parent
a50e8c0
commit 03e3b50
Showing
9 changed files
with
418 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,8 @@ for Deno. Based on [graphql-http](https://github.com/graphql/graphql-http). | |
The simplest setup with `Deno.serve`: | ||
|
||
```ts | ||
import { GraphQLHTTP } from 'https://deno.land/x/gql@1.2.4/mod.ts' | ||
import { makeExecutableSchema } from 'npm:@graphql-tools/[email protected].0' | ||
import { GraphQLHTTP } from 'jsr:@deno-libs/gql@3.0.1/mod.ts' | ||
import { makeExecutableSchema } from 'npm:@graphql-tools/[email protected].3' | ||
import { gql } from 'https://deno.land/x/[email protected]/mod.ts' | ||
|
||
const typeDefs = gql` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,5 @@ export { | |
type Request as RawRequest, | ||
type RequestParams, | ||
} from 'npm:[email protected]' | ||
export { | ||
STATUS_TEXT, | ||
type StatusCode, | ||
} from 'https://deno.land/[email protected]/http/status.ts' | ||
export { STATUS_TEXT, type StatusCode } from 'jsr:@std/[email protected]/status' | ||
export { accepts } from 'jsr:@std/[email protected]/negotiation' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { | ||
Application, | ||
Middleware, | ||
Request as OakRequest, | ||
type Middleware, | ||
type Request as OakRequest, | ||
Router, | ||
} from 'https://deno.land/x/oak@14.2.0/mod.ts' | ||
} from 'https://deno.land/x/oak@v16.1.0/mod.ts' | ||
import { GraphQLHTTP } from '../mod.ts' | ||
import { makeExecutableSchema } from 'npm:@graphql-tools/[email protected]' | ||
import { gql } from 'https://deno.land/x/[email protected]/mod.ts' | ||
|
@@ -27,7 +27,7 @@ const schema = makeExecutableSchema({ typeDefs, resolvers }) | |
const handleGraphQL: Middleware = async (ctx) => { | ||
// cast Oak request into a normal Request | ||
const req = new Request(ctx.request.url.toString(), { | ||
body: ctx.request.originalRequest.getBody().body, | ||
body: await ctx.request.body.blob(), | ||
headers: ctx.request.headers, | ||
method: ctx.request.method, | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { GraphQLHTTP } from '../mod.ts' | ||
import { makeExecutableSchema } from 'npm:@graphql-tools/[email protected]' | ||
import { gql } from 'https://deno.land/x/[email protected]/mod.ts' | ||
import type { Request as GQLRequest } from 'npm:[email protected].0' | ||
import type { Request as GQLRequest } from 'npm:[email protected].1' | ||
|
||
const typeDefs = gql` | ||
type Query { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { filterXSS } from 'https://esm.sh/[email protected]/' | ||
import { filterXSS } from 'https://esm.sh/[email protected]' | ||
import { getLoadingMarkup } from './markup.ts' | ||
|
||
export interface MiddlewareOptions { | ||
|
@@ -56,6 +56,7 @@ export interface EditorColours { | |
} | ||
|
||
export interface IntrospectionResult { | ||
// deno-lint-ignore no-explicit-any | ||
__schema: any | ||
} | ||
|
||
|
@@ -148,7 +149,7 @@ export function renderPlaygroundPage(options: RenderPageOptions) { | |
} | ||
if (!extendedOptions.endpoint && !extendedOptions.configString) { | ||
console.warn( | ||
`WARNING: You didn't provide an endpoint and don't have a .graphqlconfig. Make sure you have at least one of them.`, | ||
`WARNING: You didn't provide an endpoint and don't have a config. Make sure you have at least one of them.`, | ||
) | ||
} else if (extendedOptions.endpoint) { | ||
extendedOptions.endpoint = filter(extendedOptions.endpoint || '') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { | ||
accepts, | ||
createHandler, | ||
OperationContext, | ||
RawRequest, | ||
type OperationContext, | ||
type RawRequest, | ||
STATUS_TEXT, | ||
type StatusCode, | ||
} from './deps.ts' | ||
import { accepts } from 'https://deno.land/[email protected]/http/negotiation.ts' | ||
import { GQLOptions } from './types.ts' | ||
import type { GQLOptions } from './types.ts' | ||
|
||
function toRequest<Req = Request, Ctx = unknown>( | ||
req: Pick<Request, 'method' | 'url' | 'headers' | 'text'>, | ||
|
Oops, something went wrong.