UNPKG

kolenkainc-honohub-graphql

Version:

GraphQL middleware for honohub

25 lines (24 loc) 862 B
import { type AnyDrizzleDB } from "drizzle-graphql"; import type { GlobalPlugin } from "kolenkainc-honohub"; import { z } from "zod"; export declare const graphQLBodyValidation: z.ZodObject<{ operationName: z.ZodOptional<z.ZodString>; query: z.ZodString; variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; }, "strip", z.ZodTypeAny, { query: string; operationName?: string | undefined; variables?: Record<string, any> | undefined; }, { query: string; operationName?: string | undefined; variables?: Record<string, any> | undefined; }>; export type GraphQLPluginConfig = { route?: string; playground?: boolean | { route?: string; graphQLEndpoint?: string; }; }; export declare function useGraphQL<Database extends AnyDrizzleDB<any>>(options?: GraphQLPluginConfig): GlobalPlugin<Database>;