feat: Update to Hono v3.0.0 (#53)
* feat: Update to Hono v3.0.0 * feat(graphql-server): Update package to v0.3.0 * feat(graphql-server): Get the raw request * test(graphql-server): Update to Hono v3.0.0 * feat(graphql-server): Run `yarn prerelease` * docs(graphql-server): Add changesetpull/54/head
parent
148f114cb6
commit
ca1a2103a7
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@hono/graphql-server': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
feat: bump up Hono to version 3.0.0
|
|
@ -53,3 +53,7 @@ app.use(
|
||||||
|
|
||||||
app.fire()
|
app.fire()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
Minghe Huang <h.minghe@gmail.com>
|
||||||
|
|
|
@ -17,7 +17,7 @@ import type {
|
||||||
GraphQLFormattedError,
|
GraphQLFormattedError,
|
||||||
} from 'https://cdn.skypack.dev/graphql@16.6.0?dts'
|
} from 'https://cdn.skypack.dev/graphql@16.6.0?dts'
|
||||||
|
|
||||||
import type { Context } from 'https://deno.land/x/hono@v2.7.5/mod.ts'
|
import type { Context } from 'https://deno.land/x/hono@v3.0.0/mod.ts'
|
||||||
import { parseBody } from './parse-body.ts'
|
import { parseBody } from './parse-body.ts'
|
||||||
|
|
||||||
export type RootResolver = (ctx?: Context) => Promise<unknown> | unknown
|
export type RootResolver = (ctx?: Context) => Promise<unknown> | unknown
|
||||||
|
@ -46,7 +46,7 @@ export const graphqlServer = (options: Options) => {
|
||||||
|
|
||||||
let params: GraphQLParams
|
let params: GraphQLParams
|
||||||
try {
|
try {
|
||||||
params = await getGraphQLParams(c.req)
|
params = await getGraphQLParams(c.req.raw)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
console.error(`${e.stack || e.message}`)
|
console.error(`${e.stack || e.message}`)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { buildSchema } from 'https://cdn.skypack.dev/graphql@16.6.0?dts'
|
import { buildSchema } from 'https://cdn.skypack.dev/graphql@16.6.0?dts'
|
||||||
import { assertEquals } from 'https://deno.land/std@0.149.0/testing/asserts.ts'
|
import { assertEquals } from 'https://deno.land/std@0.177.0/testing/asserts.ts'
|
||||||
import { Hono } from 'https://deno.land/x/hono@v2.7.5/mod.ts'
|
import { Hono } from 'https://deno.land/x/hono@v3.0.0/mod.ts'
|
||||||
import { graphqlServer } from '../deno_dist/index.ts'
|
import { graphqlServer } from '../deno_dist/index.ts'
|
||||||
|
|
||||||
Deno.test('graphql-server', async (t) => {
|
Deno.test('graphql-server', async (t) => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@hono/graphql-server",
|
"name": "@hono/graphql-server",
|
||||||
"version": "0.2.0",
|
"version": "0.3.0",
|
||||||
"repository": "git@github.com:honojs/middleware.git",
|
"repository": "git@github.com:honojs/middleware.git",
|
||||||
"author": "Minghe Huang <h.minghe@gmail.com>",
|
"author": "Minghe Huang <h.minghe@gmail.com>",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
"release": "np"
|
"release": "np"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"hono": "^2.6.1"
|
"hono": "^3.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"graphql": "^16.5.0"
|
"graphql": "^16.5.0"
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
"eslint-plugin-flowtype": "^8.0.3",
|
"eslint-plugin-flowtype": "^8.0.3",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"hono": "^2.6.1",
|
"hono": "^3.0.0",
|
||||||
"jest": "^28.1.2",
|
"jest": "^28.1.2",
|
||||||
"jest-environment-miniflare": "^2.6.0",
|
"jest-environment-miniflare": "^2.6.0",
|
||||||
"np": "^7.6.2",
|
"np": "^7.6.2",
|
||||||
|
|
|
@ -46,7 +46,7 @@ export const graphqlServer = (options: Options) => {
|
||||||
|
|
||||||
let params: GraphQLParams
|
let params: GraphQLParams
|
||||||
try {
|
try {
|
||||||
params = await getGraphQLParams(c.req)
|
params = await getGraphQLParams(c.req.raw)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
console.error(`${e.stack || e.message}`)
|
console.error(`${e.stack || e.message}`)
|
||||||
|
|
Loading…
Reference in New Issue