fix(graphql-server): add type to Middleware Handler (#667)
* fix(graphql-server): add type to Middleware Handler * chore: add changesetpull/669/head
parent
e488b9f08a
commit
41ab4b029d
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@hono/graphql-server': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: add type to Middleware Handler
|
|
@ -17,7 +17,7 @@ import type {
|
||||||
GraphQLFormattedError,
|
GraphQLFormattedError,
|
||||||
} from 'graphql'
|
} from 'graphql'
|
||||||
|
|
||||||
import type { Context, Env, Input } from 'hono'
|
import type { Context, Env, Input, MiddlewareHandler } from 'hono'
|
||||||
import { parseBody } from './parse-body'
|
import { parseBody } from './parse-body'
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// 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 = {}>(
|
export const graphqlServer = <E extends Env = any, P extends string = any, I extends Input = {}>(
|
||||||
// eslint-enable-next-line @typescript-eslint/no-explicit-any
|
// eslint-enable-next-line @typescript-eslint/no-explicit-any
|
||||||
options: Options<E, P, I>
|
options: Options<E, P, I>
|
||||||
) => {
|
): MiddlewareHandler => {
|
||||||
const schema = options.schema
|
const schema = options.schema
|
||||||
const pretty = options.pretty ?? false
|
const pretty = options.pretty ?? false
|
||||||
const validationRules = options.validationRules ?? []
|
const validationRules = options.validationRules ?? []
|
||||||
|
|
Loading…
Reference in New Issue