From ca16dcf93922d63dd1783dc471b2ac0c61f8d11f Mon Sep 17 00:00:00 2001 From: "netop://ウィビ" Date: Sat, 11 Apr 2026 14:19:10 -0700 Subject: initial commit --- src/utility/types.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 src/utility/types.ts (limited to 'src/utility') diff --git a/src/utility/types.ts b/src/utility/types.ts new file mode 100755 index 0000000..c96910c --- /dev/null +++ b/src/utility/types.ts @@ -0,0 +1,48 @@ + + + +/// import + +import type { GraphQLArgs, GraphQLSchema } from "npm:graphql@16.6.0"; + +/// util + +import type { RenderPageOptions } from "../graphiql/render.ts"; + +interface MutationParams { + mutation: string; + operationName?: string; + query?: never; + variables?: Record; +} + +interface QueryParams { + mutation?: never; + operationName?: string; + query: string; + variables?: Record; +} + + + +/// export + +export interface GQLOptions extends Omit { + context?: (val: Req) => Context | Promise; + /// GraphQL playground + graphiql?: boolean; + /// Custom headers for responses + headers?: HeadersInit; + /// Custom options for GraphQL Playground + playgroundOptions?: Omit; + schema: GraphQLSchema; +} + +export type GraphQLParams = QueryParams | MutationParams; + +export type GQLRequest = { + headers: Headers; + json: () => Promise; + method: string; + url: string; +}; -- cgit v1.2.3