diff --git a/packages/graphql-server/src/index.ts b/packages/graphql-server/src/index.ts index 3e3961c9e..a30ea3cd5 100644 --- a/packages/graphql-server/src/index.ts +++ b/packages/graphql-server/src/index.ts @@ -17,26 +17,36 @@ import type { GraphQLFormattedError, } from 'graphql' -import type { Context } from 'hono' +import type { Context, Env, Input } from 'hono' import { parseBody } from './parse-body' -export type RootResolver = (ctx?: Context) => Promise | unknown +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type RootResolver = ( + // eslint-enable-next-line @typescript-eslint/no-explicit-any + ctx?: Context +) => Promise | unknown -type Options = { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type Options = { + // eslint-enable-next-line @typescript-eslint/no-explicit-any schema: GraphQLSchema - rootResolver?: RootResolver + rootResolver?: RootResolver pretty?: boolean validationRules?: ReadonlyArray // graphiql?: boolean } -export const graphqlServer = (options: Options) => { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export const graphqlServer = ( + // eslint-enable-next-line @typescript-eslint/no-explicit-any + options: Options +) => { const schema = options.schema const pretty = options.pretty ?? false const validationRules = options.validationRules ?? [] // const showGraphiQL = options.graphiql ?? false - return async (c: Context) => { + return async (c: Context) => { // GraphQL HTTP only supports GET and POST methods. if (c.req.method !== 'GET' && c.req.method !== 'POST') { return c.json(errorMessages(['GraphQL only supports GET and POST requests.']), 405, {