fix(graphql-server): add type to Middleware Handler (#667)

* fix(graphql-server): add type to Middleware Handler

* chore: add changeset
pull/669/head
3w36zj6 2024-07-28 18:18:49 +09:00 committed by GitHub
parent e488b9f08a
commit 41ab4b029d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/graphql-server': patch
---
fix: add type to Middleware Handler

View File

@ -17,7 +17,7 @@ import type {
GraphQLFormattedError,
} from 'graphql'
import type { Context, Env, Input } from 'hono'
import type { Context, Env, Input, MiddlewareHandler } from 'hono'
import { parseBody } from './parse-body'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@ -40,7 +40,7 @@ type Options<E extends Env = any, P extends string = any, I extends Input = {}>
export const graphqlServer = <E extends Env = any, P extends string = any, I extends Input = {}>(
// eslint-enable-next-line @typescript-eslint/no-explicit-any
options: Options<E, P, I>
) => {
): MiddlewareHandler => {
const schema = options.schema
const pretty = options.pretty ?? false
const validationRules = options.validationRules ?? []