Genql uses literal enums types:
javascript// genql generates this code export type SomeEnum = "X" | "Y" | "Z"; export const enumSomeEnum = { X: "X" as const, Y: "Y" as const, Z: "Z" as const, };
Genql also exports an object with name
enu{TypeName}
in case you need to use the enum at runtimeUsage
javascriptimport { createClient, enumStatus } from "./generated"; const { repository } = await createClient().query({ repository: { status: true, }, }); if (repository.status === enumStatus.active) { // repo is active }