diff --git a/bun.lock b/bun.lock index 8be79268..df9b4548 100644 --- a/bun.lock +++ b/bun.lock @@ -14,6 +14,7 @@ "drizzle-graphql": "^0.8.5", "drizzle-orm": "^0.45.2", "graphql": "^17.0.2", + "graphql-request": "^7.4.0", "hono": "4.13.2", "leven": "^4.1.0", "react": "^19.2.8", @@ -1073,6 +1074,8 @@ "graphql-parse-resolve-info": ["graphql-parse-resolve-info@4.14.1", "", { "dependencies": { "debug": "^4.1.1", "tslib": "^2.0.1" }, "peerDependencies": { "graphql": ">=0.9 <0.14 || ^14.0.2 || ^15.4.0 || ^16.3.0" } }, "sha512-WKHukfEuZamP1ZONR84b8iT+4sJgEhtXMDArm1jpXEsU2vTb5EgkCZ4Obfl+v09oNTKXm0CJjPfBUZ5jcJ2Ykg=="], + "graphql-request": ["graphql-request@7.4.0", "", { "dependencies": { "@graphql-typed-document-node/core": "^3.2.0" }, "peerDependencies": { "graphql": "14 - 16" } }, "sha512-xfr+zFb/QYbs4l4ty0dltqiXIp07U6sl+tOKAb0t50/EnQek6CVVBLjETXi+FghElytvgaAWtIOt3EV7zLzIAQ=="], + "graphql-tag": ["graphql-tag@2.12.7", "", { "dependencies": { "tslib": "^2.1.0" }, "peerDependencies": { "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-xnE/NFzy+0eIesvAsREJZ284zTl/wYuBAvpsFSDhRGRdRHdnE90M21Q3xAWyYInb0J756c6x0pIQ62+vtvOs1Q=="], "graphql-ws": ["graphql-ws@6.2.1", "", { "peerDependencies": { "@fastify/websocket": "^10 || ^11", "crossws": "~0.3", "graphql": "^15.10.1 || ^16 || ^17", "ws": "^8" }, "optionalPeers": ["@fastify/websocket", "crossws", "ws"] }, "sha512-NMbPNeTwXpUOxmczdMtzEnynLNbbR267E9hRcJ81SSbQeIvZup3cMjbD1ZT3jpS2xkpxooisitvO7LZNOyz17Q=="], diff --git a/codegen.yml b/codegen.yml index 56abcafe..98c827de 100644 --- a/codegen.yml +++ b/codegen.yml @@ -7,7 +7,9 @@ generates: plugins: - typescript - typescript-operations + - typed-document-node config: useTypeImports: true skipTypename: true - avoidOptionals: true + avoidOptionals: + field: true diff --git a/e2e/helpers.ts b/e2e/helpers.ts index da24e070..493a7391 100644 --- a/e2e/helpers.ts +++ b/e2e/helpers.ts @@ -1,4 +1,5 @@ import type { Page } from "@playwright/test"; +import { print } from "graphql"; import { DELETE_PROGRAM_MUTATION } from "../src/shared/gqlQueries"; import { AUTH_BYPASS_USER_ID, @@ -45,7 +46,7 @@ export async function deleteProgramViaApi( "x-session-id": TRIPWIRE_HEADER_VALUE, }, data: { - query: DELETE_PROGRAM_MUTATION, + query: print(DELETE_PROGRAM_MUTATION), variables: { id: programId }, }, }); diff --git a/package.json b/package.json index 2924f11f..7e673204 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "drizzle-graphql": "^0.8.5", "drizzle-orm": "^0.45.2", "graphql": "^17.0.2", + "graphql-request": "^7.4.0", "hono": "4.13.2", "leven": "^4.1.0", "react": "^19.2.8", diff --git a/src/react-app/api/graphQlClient.spec.ts b/src/react-app/api/graphQlClient.spec.ts index d042b643..c822ca4d 100644 --- a/src/react-app/api/graphQlClient.spec.ts +++ b/src/react-app/api/graphQlClient.spec.ts @@ -1,181 +1,197 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; -import { graphqlFetch } from "./graphQlClient"; +import { + GET_PROGRAMS_QUERY, + SUBMIT_GUESS_MUTATION, +} from "../../shared/gqlQueries"; +import { graphqlRequest } from "./graphQlClient"; const mockFetch = vi.fn(); beforeEach(() => { - globalThis.fetch = mockFetch; + vi.spyOn(globalThis, "fetch").mockImplementation(mockFetch); }); -const okJsonResponse = (data: unknown) => - ({ ok: true, status: 200, json: async () => data }) as unknown as Response; - -const statusResponse = (status: number, data?: unknown) => +const jsonResponse = (payload: unknown, status = 200) => ({ - ok: false, + ok: status >= 200 && status < 300, status, - json: async () => data, + headers: { + get: (name: string) => + name.toLowerCase() === "content-type" ? "application/json" : null, + }, + text: async () => JSON.stringify(payload), }) as unknown as Response; -describe("graphqlFetch", () => { - it("returns data on successful fetch", async () => { - mockFetch.mockResolvedValueOnce(okJsonResponse({ data: { token: "abc" } })); +describe("graphqlRequest", () => { + it("returns data on successful request", async () => { + mockFetch.mockResolvedValueOnce( + jsonResponse({ + data: { programs: [{ id: "p1", name: "Program 1" }] }, + }), + ); - const result = await graphqlFetch<{ token: string }>("query { token }"); + const result = await graphqlRequest(GET_PROGRAMS_QUERY); - expect(result).toEqual({ token: "abc" }); + expect(result).toEqual({ + programs: [{ id: "p1", name: "Program 1" }], + }); }); it("sends correct request shape", async () => { mockFetch.mockResolvedValueOnce( - okJsonResponse({ data: { success: true } }), + jsonResponse({ + data: { + submitGuess: { + success: true, + message: "ok", + canRequestClue: false, + nextGate: null, + }, + }, + }), ); - await graphqlFetch("mutation { doThing }", { input: "foo" }); - - expect(mockFetch).toHaveBeenCalledWith("/api/graphql", { - method: "POST", - headers: { - "Content-Type": "application/json", - "x-session-id": "terminal-quiz", - }, - body: JSON.stringify({ - query: "mutation { doThing }", - variables: { input: "foo" }, - }), + await graphqlRequest(SUBMIT_GUESS_MUTATION, { + programId: "prog-1", + gateId: "gate-1", + guess: "my answer", + }); + + const [url, options] = mockFetch.mock.calls[0] as [Request, RequestInit]; + expect(new URL(url as unknown as string).pathname).toBe("/api/graphql"); + expect(options.method).toBe("POST"); + const headers = new Headers(options.headers); + expect(headers.get("Content-Type")).toBe("application/json"); + const body = JSON.parse(options.body as string); + expect(body.query).toContain("SubmitGuess"); + expect(body.variables).toEqual({ + programId: "prog-1", + gateId: "gate-1", + guess: "my answer", }); }); - it("sends query without variables when none provided", async () => { - mockFetch.mockResolvedValueOnce(okJsonResponse({ data: { ok: true } })); + it("omits variables when none provided", async () => { + mockFetch.mockResolvedValueOnce(jsonResponse({ data: { programs: [] } })); - await graphqlFetch("{ test }"); + await graphqlRequest(GET_PROGRAMS_QUERY); - const [, options] = mockFetch.mock.calls[0] as [string, RequestInit]; - const callBody = JSON.parse(options.body as string); - expect(callBody.query).toBe("{ test }"); - expect(callBody.variables).toBeUndefined(); + const [, options] = mockFetch.mock.calls[0] as [Request, RequestInit]; + const body = JSON.parse(options.body as string); + expect(body.query).toContain("GetPrograms"); + expect(body.variables).toBeUndefined(); }); it("includes the constant x-session-id tripwire header", async () => { - mockFetch.mockResolvedValueOnce(okJsonResponse({ data: { ok: true } })); + mockFetch.mockResolvedValueOnce(jsonResponse({ data: { programs: [] } })); - await graphqlFetch("{ test }"); + await graphqlRequest(GET_PROGRAMS_QUERY); - const [, options] = mockFetch.mock.calls[0] as [string, RequestInit]; - const headers = options.headers as Record; - expect(headers["x-session-id"]).toBe("terminal-quiz"); + const [, options] = mockFetch.mock.calls[0] as [Request, RequestInit]; + const headers = new Headers(options.headers); + expect(headers.get("x-session-id")).toBe("terminal-quiz"); }); it("throws fallback message on HTTP 500 without body", async () => { - mockFetch.mockResolvedValueOnce(statusResponse(500)); + mockFetch.mockResolvedValueOnce({ + ok: false, + status: 500, + headers: { get: () => "application/json" }, + text: async () => "", + } as unknown as Response); - await expect(graphqlFetch("{ test }")).rejects.toThrow( + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toThrow( "GraphQL request failed with HTTP 500.", ); }); it("throws error message from GraphQL error body on HTTP 500", async () => { mockFetch.mockResolvedValueOnce( - statusResponse(500, { - data: null, - errors: [{ message: "Internal server error" }], - }), + jsonResponse( + { data: null, errors: [{ message: "Internal server error" }] }, + 500, + ), ); - await expect(graphqlFetch("{ test }")).rejects.toThrow( + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toThrow( "Internal server error", ); }); it("throws first error message when HTTP is ok but response has errors", async () => { mockFetch.mockResolvedValueOnce( - okJsonResponse({ - data: null, - errors: [{ message: "Not found" }], - }), + jsonResponse({ data: null, errors: [{ message: "Not found" }] }), ); - await expect(graphqlFetch("{ test }")).rejects.toThrow("Not found"); + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toThrow( + "Not found", + ); }); it("uses first error when multiple errors present", async () => { mockFetch.mockResolvedValueOnce( - okJsonResponse({ + jsonResponse({ data: null, errors: [{ message: "First error" }, { message: "Second error" }], }), ); - await expect(graphqlFetch("{ test }")).rejects.toThrow("First error"); + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toThrow( + "First error", + ); }); it("falls back to generic message when error has no message", async () => { - mockFetch.mockResolvedValueOnce( - okJsonResponse({ - data: null, - errors: [{}], - }), - ); + mockFetch.mockResolvedValueOnce(jsonResponse({ data: null, errors: [{}] })); - await expect(graphqlFetch("{ test }")).rejects.toThrow( + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toThrow( "GraphQL request failed with HTTP 200.", ); }); it("returns data when errors array is empty but data is present", async () => { mockFetch.mockResolvedValueOnce( - okJsonResponse({ - data: { valid: true }, - errors: [], - }), + jsonResponse({ data: { programs: [] }, errors: [] }), ); - const result = await graphqlFetch<{ valid: boolean }>("{ test }"); - expect(result).toEqual({ valid: true }); + const result = await graphqlRequest(GET_PROGRAMS_QUERY); + expect(result).toEqual({ programs: [] }); }); it("throws when data field is missing from response", async () => { - mockFetch.mockResolvedValueOnce(okJsonResponse({})); + mockFetch.mockResolvedValueOnce(jsonResponse({})); - await expect(graphqlFetch("{ test }")).rejects.toThrow( + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toThrow( "GraphQL response did not include data.", ); }); - it("throws on malformed JSON response", async () => { - mockFetch.mockResolvedValueOnce({ - ok: true, - status: 200, - json: async () => { - throw new SyntaxError("Unexpected token"); - }, - } as unknown as Response); - - await expect(graphqlFetch("{ test }")).rejects.toThrow( - "GraphQL request failed with HTTP 200.", - ); - }); - - it("throws on null response body", async () => { - mockFetch.mockResolvedValueOnce(okJsonResponse(null)); + it("throws when data is null with an empty errors array", async () => { + mockFetch.mockResolvedValueOnce(jsonResponse({ data: null, errors: [] })); - await expect(graphqlFetch("{ test }")).rejects.toThrow( + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toThrow( "GraphQL response did not include data.", ); }); - it("throws on array response body", async () => { - mockFetch.mockResolvedValueOnce(okJsonResponse([])); + it("propagates JSON parse errors unchanged", async () => { + mockFetch.mockResolvedValueOnce({ + ok: true, + status: 200, + headers: { get: () => "application/json" }, + text: async () => "", + } as unknown as Response); - await expect(graphqlFetch("{ test }")).rejects.toThrow( - "GraphQL response did not include data.", + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toBeInstanceOf( + SyntaxError, ); }); it("propagates network error when fetch fails", async () => { mockFetch.mockRejectedValueOnce(new TypeError("Failed to fetch")); - await expect(graphqlFetch("{ test }")).rejects.toThrow("Failed to fetch"); + await expect(graphqlRequest(GET_PROGRAMS_QUERY)).rejects.toThrow( + "Failed to fetch", + ); }); }); diff --git a/src/react-app/api/graphQlClient.ts b/src/react-app/api/graphQlClient.ts index 1ff4101b..5b90e96a 100644 --- a/src/react-app/api/graphQlClient.ts +++ b/src/react-app/api/graphQlClient.ts @@ -1,50 +1,65 @@ -const GRAPHQL_ENDPOINT = "/api/graphql"; +import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import type { RequestDocument } from "graphql-request"; +import { ClientError, GraphQLClient } from "graphql-request"; + const SESSION_HEADER = "x-session-id"; // Constant, value-agnostic same-origin tripwire required on mutations by the // worker's requireSessionHeader. Presence proves same-origin JS; identity is // the server-issued session cookie (HttpOnly), never this header. const SESSION_HEADER_VALUE = "terminal-quiz"; -export const graphqlFetch = async ( - query: string, - variables?: Record, -): Promise => { - const response = await fetch(GRAPHQL_ENDPOINT, { - method: "POST", - headers: { - "Content-Type": "application/json", - [SESSION_HEADER]: SESSION_HEADER_VALUE, - }, - body: JSON.stringify({ - query, - variables, - }), - }); +const GRAPHQL_ENDPOINT = new URL( + "/api/graphql", + globalThis.location?.origin ?? "http://localhost", +).toString(); - let json: { data?: T; errors?: Array<{ message?: string }> } = {}; - try { - const parsed: unknown = await response.json(); - if ( - parsed !== null && - typeof parsed === "object" && - !Array.isArray(parsed) - ) { - json = parsed as { data?: T; errors?: Array<{ message?: string }> }; - } - } catch { - throw new Error(`GraphQL request failed with HTTP ${response.status}.`); - } +/** + * Shared GraphQL client. Handles transport, headers, and JSON serialization; + * documents are TypedDocumentNode constants (typed-document-node) from + * `src/shared/gqlQueries.ts`. + * + * Dependency note: graphql-request@7.4.0 declares a peer range of graphql + * 14-16, but this repo runs graphql 17.0.2. The override is intentional and + * verified: graphql-request only exercises stable core exports (print, parse, + * Kind, ClientError), and the full unit (619) and integration (80) suites pass + * against graphql 17. + */ +export const graphqlClient = new GraphQLClient(GRAPHQL_ENDPOINT, { + headers: { + "Content-Type": "application/json", + [SESSION_HEADER]: SESSION_HEADER_VALUE, + }, +}); - if (!response.ok || (json.errors?.length ?? 0) > 0) { - throw new Error( - json.errors?.[0]?.message || - `GraphQL request failed with HTTP ${response.status}.`, +/** + * Typed GraphQL request helper. Thin wrapper over `graphqlClient` that + * normalizes `ClientError` (whose message embeds the full request/response + * JSON) down to the first GraphQL error message, preserving the previous + * fetch-based contract. Network and parse errors pass through unchanged. + */ +export const graphqlRequest = async < + TData, + TVariables extends Record = Record, +>( + document: TypedDocumentNode, + variables?: TVariables, +): Promise => { + try { + const data = await graphqlClient.request( + document as unknown as RequestDocument, + variables, ); + if (data === undefined || data === null) { + throw new Error("GraphQL response did not include data."); + } + return data; + } catch (error) { + if (error instanceof ClientError) { + const message = + error.response.errors?.[0]?.message ?? + `GraphQL request failed with HTTP ${error.response.status}.`; + throw new Error(message); + } + throw error; } - - if (json.data === undefined) { - throw new Error("GraphQL response did not include data."); - } - - return json.data; }; diff --git a/src/react-app/api/mutations/useCreateGateMutation.spec.ts b/src/react-app/api/mutations/useCreateGateMutation.spec.ts index 01aee8c4..3eaa144d 100644 --- a/src/react-app/api/mutations/useCreateGateMutation.spec.ts +++ b/src/react-app/api/mutations/useCreateGateMutation.spec.ts @@ -13,19 +13,21 @@ beforeEach(() => { describe("useCreateGateMutation", () => { it("sends create gate mutation", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - createGate: { - id: "gate-1", - programId: PROGRAM_ID, - label: "Gate 1", - question: "Q1", - sequenceOrder: 1, + text: async () => + JSON.stringify({ + data: { + createGate: { + id: "gate-1", + programId: PROGRAM_ID, + label: "Gate 1", + question: "Q1", + sequenceOrder: 1, + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useCreateGateMutation(PROGRAM_ID), { @@ -50,19 +52,21 @@ describe("useCreateGateMutation", () => { it("invalidates programGates cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - createGate: { - id: "gate-1", - programId: PROGRAM_ID, - label: "Gate 1", - question: "Q1", - sequenceOrder: 1, + text: async () => + JSON.stringify({ + data: { + createGate: { + id: "gate-1", + programId: PROGRAM_ID, + label: "Gate 1", + question: "Q1", + sequenceOrder: 1, + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); diff --git a/src/react-app/api/mutations/useCreateGateMutation.ts b/src/react-app/api/mutations/useCreateGateMutation.ts index e0947dd9..ea1c07d4 100644 --- a/src/react-app/api/mutations/useCreateGateMutation.ts +++ b/src/react-app/api/mutations/useCreateGateMutation.ts @@ -1,6 +1,6 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { CREATE_GATE_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; export type CreateGateVariables = { @@ -16,7 +16,7 @@ export type CreateGateVariables = { }; const createGate = async (variables: CreateGateVariables): Promise => { - await graphqlFetch(CREATE_GATE_MUTATION, variables); + await graphqlRequest(CREATE_GATE_MUTATION, variables); }; export const useCreateGateMutation = (programId: string) => { diff --git a/src/react-app/api/mutations/useCreateProgramMutation.spec.ts b/src/react-app/api/mutations/useCreateProgramMutation.spec.ts index 5ad6e62f..667c0b00 100644 --- a/src/react-app/api/mutations/useCreateProgramMutation.spec.ts +++ b/src/react-app/api/mutations/useCreateProgramMutation.spec.ts @@ -19,9 +19,10 @@ describe("useCreateProgramMutation", () => { createdAt: "2024-01-01T00:00:00.000Z", }; mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { createProgram: response } }), - } as Response); + text: async () => JSON.stringify({ data: { createProgram: response } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useCreateProgramMutation(), { @@ -38,19 +39,21 @@ describe("useCreateProgramMutation", () => { it("invalidates myPrograms cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - createProgram: { - id: "prog-1", - name: "My Program", - visibility: "public", - authorId: "user-1", - createdAt: "2024-01-01T00:00:00.000Z", + text: async () => + JSON.stringify({ + data: { + createProgram: { + id: "prog-1", + name: "My Program", + visibility: "public", + authorId: "user-1", + createdAt: "2024-01-01T00:00:00.000Z", + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); diff --git a/src/react-app/api/mutations/useCreateProgramMutation.ts b/src/react-app/api/mutations/useCreateProgramMutation.ts index b6a3753d..8333c158 100644 --- a/src/react-app/api/mutations/useCreateProgramMutation.ts +++ b/src/react-app/api/mutations/useCreateProgramMutation.ts @@ -1,6 +1,6 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { CREATE_PROGRAM_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; export type CreateProgramResponse = { @@ -15,10 +15,13 @@ const createProgram = async ( name: string, visibility: string, ): Promise => { - const result = await graphqlFetch<{ createProgram: CreateProgramResponse }>( - CREATE_PROGRAM_MUTATION, - { name, visibility }, - ); + const result = await graphqlRequest(CREATE_PROGRAM_MUTATION, { + name, + visibility, + }); + if (!result.createProgram) { + throw new Error("Failed to create program."); + } return result.createProgram; }; diff --git a/src/react-app/api/mutations/useDeleteGateMutation.spec.ts b/src/react-app/api/mutations/useDeleteGateMutation.spec.ts index dff4ea43..63a80b97 100644 --- a/src/react-app/api/mutations/useDeleteGateMutation.spec.ts +++ b/src/react-app/api/mutations/useDeleteGateMutation.spec.ts @@ -13,9 +13,10 @@ beforeEach(() => { describe("useDeleteGateMutation", () => { it("sends delete gate mutation", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { deleteGate: true } }), - } as Response); + text: async () => JSON.stringify({ data: { deleteGate: true } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useDeleteGateMutation(PROGRAM_ID), { @@ -33,9 +34,10 @@ describe("useDeleteGateMutation", () => { it("invalidates programGates cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { deleteGate: true } }), - } as Response); + text: async () => JSON.stringify({ data: { deleteGate: true } }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); diff --git a/src/react-app/api/mutations/useDeleteGateMutation.ts b/src/react-app/api/mutations/useDeleteGateMutation.ts index fd22c88c..378569b5 100644 --- a/src/react-app/api/mutations/useDeleteGateMutation.ts +++ b/src/react-app/api/mutations/useDeleteGateMutation.ts @@ -1,10 +1,10 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { DELETE_GATE_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; const deleteGate = async (id: string): Promise => { - await graphqlFetch(DELETE_GATE_MUTATION, { id }); + await graphqlRequest(DELETE_GATE_MUTATION, { id }); }; export const useDeleteGateMutation = (programId: string) => { diff --git a/src/react-app/api/mutations/useDeleteProgramMutation.spec.ts b/src/react-app/api/mutations/useDeleteProgramMutation.spec.ts index 991a32d6..3ff71018 100644 --- a/src/react-app/api/mutations/useDeleteProgramMutation.spec.ts +++ b/src/react-app/api/mutations/useDeleteProgramMutation.spec.ts @@ -12,9 +12,10 @@ beforeEach(() => { describe("useDeleteProgramMutation", () => { it("sends delete mutation", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { deleteProgram: true } }), - } as Response); + text: async () => JSON.stringify({ data: { deleteProgram: true } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useDeleteProgramMutation(), { @@ -32,9 +33,10 @@ describe("useDeleteProgramMutation", () => { it("invalidates myPrograms cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { deleteProgram: true } }), - } as Response); + text: async () => JSON.stringify({ data: { deleteProgram: true } }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); diff --git a/src/react-app/api/mutations/useDeleteProgramMutation.ts b/src/react-app/api/mutations/useDeleteProgramMutation.ts index 83dabb41..b05b6ad3 100644 --- a/src/react-app/api/mutations/useDeleteProgramMutation.ts +++ b/src/react-app/api/mutations/useDeleteProgramMutation.ts @@ -1,10 +1,10 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { DELETE_PROGRAM_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; const deleteProgram = async (id: string): Promise => { - await graphqlFetch(DELETE_PROGRAM_MUTATION, { id }); + await graphqlRequest(DELETE_PROGRAM_MUTATION, { id }); }; export const useDeleteProgramMutation = () => { diff --git a/src/react-app/api/mutations/useReorderGatesMutation.spec.ts b/src/react-app/api/mutations/useReorderGatesMutation.spec.ts index ee5b3d0c..079edc74 100644 --- a/src/react-app/api/mutations/useReorderGatesMutation.spec.ts +++ b/src/react-app/api/mutations/useReorderGatesMutation.spec.ts @@ -13,9 +13,10 @@ beforeEach(() => { describe("useReorderGatesMutation", () => { it("sends reorder mutation", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { reorderGates: true } }), - } as Response); + text: async () => JSON.stringify({ data: { reorderGates: true } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useReorderGatesMutation(PROGRAM_ID), { @@ -39,9 +40,10 @@ describe("useReorderGatesMutation", () => { it("invalidates programGates cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { reorderGates: true } }), - } as Response); + text: async () => JSON.stringify({ data: { reorderGates: true } }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); diff --git a/src/react-app/api/mutations/useReorderGatesMutation.ts b/src/react-app/api/mutations/useReorderGatesMutation.ts index 006d15cf..072849bd 100644 --- a/src/react-app/api/mutations/useReorderGatesMutation.ts +++ b/src/react-app/api/mutations/useReorderGatesMutation.ts @@ -1,6 +1,6 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { REORDER_GATES_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; export type ReorderGatesVariables = { @@ -11,7 +11,7 @@ export type ReorderGatesVariables = { const reorderGates = async ( variables: ReorderGatesVariables, ): Promise => { - await graphqlFetch(REORDER_GATES_MUTATION, variables); + await graphqlRequest(REORDER_GATES_MUTATION, variables); }; export const useReorderGatesMutation = (programId: string) => { diff --git a/src/react-app/api/mutations/useRequestClueMutation.spec.ts b/src/react-app/api/mutations/useRequestClueMutation.spec.ts index 95d57c26..3c472613 100644 --- a/src/react-app/api/mutations/useRequestClueMutation.spec.ts +++ b/src/react-app/api/mutations/useRequestClueMutation.spec.ts @@ -18,9 +18,10 @@ describe("useRequestClueMutation", () => { cluesRemaining: 2, }; mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { requestClue: response } }), - } as Response); + text: async () => JSON.stringify({ data: { requestClue: response } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useRequestClueMutation(mockProgramId), { @@ -37,17 +38,19 @@ describe("useRequestClueMutation", () => { it("sends correct mutation query and variables", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - requestClue: { - clueText: "Hint", - isClueLimitReached: false, - cluesRemaining: 2, + text: async () => + JSON.stringify({ + data: { + requestClue: { + clueText: "Hint", + isClueLimitReached: false, + cluesRemaining: 2, + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useRequestClueMutation(mockProgramId), { @@ -72,17 +75,19 @@ describe("useRequestClueMutation", () => { it("returns null clueText when clue cannot be generated", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - requestClue: { - clueText: null, - isClueLimitReached: true, - cluesRemaining: 0, + text: async () => + JSON.stringify({ + data: { + requestClue: { + clueText: null, + isClueLimitReached: true, + cluesRemaining: 0, + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useRequestClueMutation(mockProgramId), { @@ -101,9 +106,11 @@ describe("useRequestClueMutation", () => { it("rejects on GraphQL error response", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ errors: [{ message: "Clue limit reached" }] }), - } as Response); + text: async () => + JSON.stringify({ errors: [{ message: "Clue limit reached" }] }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useRequestClueMutation(mockProgramId), { @@ -130,10 +137,11 @@ describe("useRequestClueMutation", () => { it("rejects on HTTP failure", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: false, status: 500, - json: async () => ({}), - } as Response); + text: async () => JSON.stringify({}), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useRequestClueMutation(mockProgramId), { @@ -147,17 +155,19 @@ describe("useRequestClueMutation", () => { it("does not invalidate query cache (no onSuccess handler)", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - requestClue: { - clueText: "Hint", - isClueLimitReached: false, - cluesRemaining: 2, + text: async () => + JSON.stringify({ + data: { + requestClue: { + clueText: "Hint", + isClueLimitReached: false, + cluesRemaining: 2, + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); diff --git a/src/react-app/api/mutations/useRequestClueMutation.ts b/src/react-app/api/mutations/useRequestClueMutation.ts index 002896ce..a6150474 100644 --- a/src/react-app/api/mutations/useRequestClueMutation.ts +++ b/src/react-app/api/mutations/useRequestClueMutation.ts @@ -1,6 +1,6 @@ import { useMutation } from "@tanstack/react-query"; import { REQUEST_CLUE_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; export type RequestClueResponse = { clueText: string | null; @@ -16,10 +16,14 @@ const requestClue = async ( gateId: string, currentGuess: string, ): Promise => { - const result = await graphqlFetch<{ requestClue: RequestClueResponse }>( - REQUEST_CLUE_MUTATION, - { programId, gateId, currentGuess }, - ); + const result = await graphqlRequest(REQUEST_CLUE_MUTATION, { + programId, + gateId, + currentGuess, + }); + if (!result.requestClue) { + throw new Error("Failed to request clue."); + } return result.requestClue; }; diff --git a/src/react-app/api/mutations/useSubmitGuessMutation.spec.ts b/src/react-app/api/mutations/useSubmitGuessMutation.spec.ts index 38ab443c..4144c79d 100644 --- a/src/react-app/api/mutations/useSubmitGuessMutation.spec.ts +++ b/src/react-app/api/mutations/useSubmitGuessMutation.spec.ts @@ -19,9 +19,10 @@ describe("useSubmitGuessMutation", () => { nextGate: { id: "gate-2", label: "Gate 2", question: "Next?" }, }; mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { submitGuess: response } }), - } as Response); + text: async () => JSON.stringify({ data: { submitGuess: response } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useSubmitGuessMutation(mockProgramId), { @@ -38,13 +39,19 @@ describe("useSubmitGuessMutation", () => { it("sends correct mutation query and variables", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - submitGuess: { success: true, canRequestClue: false, nextGate: null }, - }, - }), - } as Response); + text: async () => + JSON.stringify({ + data: { + submitGuess: { + success: true, + canRequestClue: false, + nextGate: null, + }, + }, + }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useSubmitGuessMutation(mockProgramId), { @@ -66,13 +73,19 @@ describe("useSubmitGuessMutation", () => { it("invalidates progression cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - submitGuess: { success: true, canRequestClue: false, nextGate: null }, - }, - }), - } as Response); + text: async () => + JSON.stringify({ + data: { + submitGuess: { + success: true, + canRequestClue: false, + nextGate: null, + }, + }, + }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); @@ -91,11 +104,13 @@ describe("useSubmitGuessMutation", () => { it("rejects on GraphQL error response", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - errors: [{ message: "Invalid guess" }], - }), - } as Response); + text: async () => + JSON.stringify({ + errors: [{ message: "Invalid guess" }], + }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useSubmitGuessMutation(mockProgramId), { @@ -109,10 +124,11 @@ describe("useSubmitGuessMutation", () => { it("rejects on HTTP failure", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: false, status: 500, - json: async () => ({}), - } as Response); + text: async () => JSON.stringify({}), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useSubmitGuessMutation(mockProgramId), { diff --git a/src/react-app/api/mutations/useSubmitGuessMutation.ts b/src/react-app/api/mutations/useSubmitGuessMutation.ts index 73ac988a..fa4dbba0 100644 --- a/src/react-app/api/mutations/useSubmitGuessMutation.ts +++ b/src/react-app/api/mutations/useSubmitGuessMutation.ts @@ -1,7 +1,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import type { SubmitGuessMutation } from "../../../shared/generated/graphql"; import { SUBMIT_GUESS_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { PROGRAM_KEYS } from "../queryKeys"; export type SubmitGuessResponse = NonNullable< @@ -13,10 +13,11 @@ const submitGuess = async ( gateId: string, guess: string, ): Promise => { - const result = await graphqlFetch( - SUBMIT_GUESS_MUTATION, - { programId, gateId, guess }, - ); + const result = await graphqlRequest(SUBMIT_GUESS_MUTATION, { + programId, + gateId, + guess, + }); if (result.submitGuess === null) { throw new Error("submitGuess returned no payload."); } diff --git a/src/react-app/api/mutations/useUpdateGateMutation.spec.ts b/src/react-app/api/mutations/useUpdateGateMutation.spec.ts index 05aafd98..344e9834 100644 --- a/src/react-app/api/mutations/useUpdateGateMutation.spec.ts +++ b/src/react-app/api/mutations/useUpdateGateMutation.spec.ts @@ -13,17 +13,19 @@ beforeEach(() => { describe("useUpdateGateMutation", () => { it("sends update gate mutation", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - updateGate: { - id: "gate-1", - label: "Updated", - sequenceOrder: 1, + text: async () => + JSON.stringify({ + data: { + updateGate: { + id: "gate-1", + label: "Updated", + sequenceOrder: 1, + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useUpdateGateMutation(PROGRAM_ID), { @@ -45,13 +47,15 @@ describe("useUpdateGateMutation", () => { it("invalidates programGates cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - updateGate: { id: "gate-1", label: "Updated", sequenceOrder: 1 }, - }, - }), - } as Response); + text: async () => + JSON.stringify({ + data: { + updateGate: { id: "gate-1", label: "Updated", sequenceOrder: 1 }, + }, + }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); diff --git a/src/react-app/api/mutations/useUpdateGateMutation.ts b/src/react-app/api/mutations/useUpdateGateMutation.ts index eb8d2cba..1259f796 100644 --- a/src/react-app/api/mutations/useUpdateGateMutation.ts +++ b/src/react-app/api/mutations/useUpdateGateMutation.ts @@ -1,6 +1,6 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { UPDATE_GATE_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; export type UpdateGateVariables = { @@ -16,7 +16,7 @@ export type UpdateGateVariables = { }; const updateGate = async (variables: UpdateGateVariables): Promise => { - await graphqlFetch(UPDATE_GATE_MUTATION, variables); + await graphqlRequest(UPDATE_GATE_MUTATION, variables); }; export const useUpdateGateMutation = (programId: string) => { diff --git a/src/react-app/api/mutations/useUpdateProgramMutation.spec.ts b/src/react-app/api/mutations/useUpdateProgramMutation.spec.ts index 39b29256..4027b314 100644 --- a/src/react-app/api/mutations/useUpdateProgramMutation.spec.ts +++ b/src/react-app/api/mutations/useUpdateProgramMutation.spec.ts @@ -12,17 +12,19 @@ beforeEach(() => { describe("useUpdateProgramMutation", () => { it("sends update mutation", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - updateProgram: { - id: "prog-1", - name: "Updated", - visibility: "unlisted", + text: async () => + JSON.stringify({ + data: { + updateProgram: { + id: "prog-1", + name: "Updated", + visibility: "unlisted", + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useUpdateProgramMutation(), { @@ -48,17 +50,19 @@ describe("useUpdateProgramMutation", () => { it("invalidates myPrograms cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - updateProgram: { - id: "prog-1", - name: "Updated", - visibility: "public", + text: async () => + JSON.stringify({ + data: { + updateProgram: { + id: "prog-1", + name: "Updated", + visibility: "public", + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); diff --git a/src/react-app/api/mutations/useUpdateProgramMutation.ts b/src/react-app/api/mutations/useUpdateProgramMutation.ts index bd6d74a5..baafee57 100644 --- a/src/react-app/api/mutations/useUpdateProgramMutation.ts +++ b/src/react-app/api/mutations/useUpdateProgramMutation.ts @@ -1,6 +1,6 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { UPDATE_PROGRAM_MUTATION } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; const updateProgram = async ( @@ -8,7 +8,7 @@ const updateProgram = async ( name?: string, visibility?: string, ): Promise => { - await graphqlFetch(UPDATE_PROGRAM_MUTATION, { id, name, visibility }); + await graphqlRequest(UPDATE_PROGRAM_MUTATION, { id, name, visibility }); }; export const useUpdateProgramMutation = () => { diff --git a/src/react-app/api/queries/useInProgressProgramQuery.spec.ts b/src/react-app/api/queries/useInProgressProgramQuery.spec.ts index f3b33f4f..d36d089b 100644 --- a/src/react-app/api/queries/useInProgressProgramQuery.spec.ts +++ b/src/react-app/api/queries/useInProgressProgramQuery.spec.ts @@ -13,9 +13,11 @@ beforeEach(() => { describe("inProgressProgramQueryOptions", () => { it("returns program id when session has in-progress program", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { getInProgressProgram: "prog-1" } }), - } as Response); + text: async () => + JSON.stringify({ data: { getInProgressProgram: "prog-1" } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook( @@ -29,9 +31,11 @@ describe("inProgressProgramQueryOptions", () => { it("returns null when no in-progress program exists", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { getInProgressProgram: null } }), - } as Response); + text: async () => + JSON.stringify({ data: { getInProgressProgram: null } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook( @@ -56,9 +60,11 @@ describe("inProgressProgramQueryOptions", () => { it("sends GetInProgressProgram query", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { getInProgressProgram: null } }), - } as Response); + text: async () => + JSON.stringify({ data: { getInProgressProgram: null } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); renderHook(() => useQuery(inProgressProgramQueryOptions), { wrapper }); @@ -76,10 +82,11 @@ describe("inProgressProgramQueryOptions", () => { it("rejects on query error", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: false, status: 500, - json: async () => ({}), - } as Response); + text: async () => JSON.stringify({}), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook( diff --git a/src/react-app/api/queries/useInProgressProgramQuery.ts b/src/react-app/api/queries/useInProgressProgramQuery.ts index 6fdfab14..6aced3ab 100644 --- a/src/react-app/api/queries/useInProgressProgramQuery.ts +++ b/src/react-app/api/queries/useInProgressProgramQuery.ts @@ -1,11 +1,9 @@ import { GET_IN_PROGRESS_PROGRAM_QUERY } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { PROGRAM_KEYS } from "../queryKeys"; const fetchInProgressProgram = async (): Promise => { - const result = await graphqlFetch<{ getInProgressProgram: string | null }>( - GET_IN_PROGRESS_PROGRAM_QUERY, - ); + const result = await graphqlRequest(GET_IN_PROGRESS_PROGRAM_QUERY); return result.getInProgressProgram; }; diff --git a/src/react-app/api/queries/useMeQuery.spec.ts b/src/react-app/api/queries/useMeQuery.spec.ts index 1e87b0e2..a29cfb04 100644 --- a/src/react-app/api/queries/useMeQuery.spec.ts +++ b/src/react-app/api/queries/useMeQuery.spec.ts @@ -7,9 +7,10 @@ describe("useMeQuery", () => { it("returns user when authenticated", async () => { const mockUser = { id: "1", email: "a@b.com", name: "Test", image: null }; vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { me: mockUser } }), - } as Response); + text: async () => JSON.stringify({ data: { me: mockUser } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useMeQuery(), { wrapper }); @@ -20,9 +21,10 @@ describe("useMeQuery", () => { it("returns null when unauthenticated", async () => { vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { me: null } }), - } as Response); + text: async () => JSON.stringify({ data: { me: null } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useMeQuery(), { wrapper }); diff --git a/src/react-app/api/queries/useMeQuery.ts b/src/react-app/api/queries/useMeQuery.ts index 947691be..f55ced6c 100644 --- a/src/react-app/api/queries/useMeQuery.ts +++ b/src/react-app/api/queries/useMeQuery.ts @@ -1,6 +1,6 @@ import { queryOptions, useQuery } from "@tanstack/react-query"; import { ME_QUERY } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; export type Me = { id: string; @@ -10,7 +10,7 @@ export type Me = { }; const fetchMe = async (): Promise => { - const data = await graphqlFetch<{ me: Me | null }>(ME_QUERY); + const data = await graphqlRequest(ME_QUERY); return data.me; }; diff --git a/src/react-app/api/queries/useMyProgramsQuery.spec.ts b/src/react-app/api/queries/useMyProgramsQuery.spec.ts index 97a5ef6f..9fddae82 100644 --- a/src/react-app/api/queries/useMyProgramsQuery.spec.ts +++ b/src/react-app/api/queries/useMyProgramsQuery.spec.ts @@ -9,9 +9,10 @@ describe("useMyProgramsQuery", () => { { id: "1", name: "My Program", visibility: "public", authorId: "user-1" }, ]; vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { myPrograms: mockPrograms } }), - } as Response); + text: async () => JSON.stringify({ data: { myPrograms: mockPrograms } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useMyProgramsQuery(), { wrapper }); @@ -22,9 +23,10 @@ describe("useMyProgramsQuery", () => { it("returns empty array when null", async () => { vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { myPrograms: null } }), - } as Response); + text: async () => JSON.stringify({ data: { myPrograms: null } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useMyProgramsQuery(), { wrapper }); diff --git a/src/react-app/api/queries/useMyProgramsQuery.ts b/src/react-app/api/queries/useMyProgramsQuery.ts index 80af2dc8..d160cffd 100644 --- a/src/react-app/api/queries/useMyProgramsQuery.ts +++ b/src/react-app/api/queries/useMyProgramsQuery.ts @@ -1,6 +1,6 @@ import { queryOptions, useQuery } from "@tanstack/react-query"; import { MY_PROGRAMS_QUERY } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; export type MyProgram = { @@ -11,10 +11,11 @@ export type MyProgram = { }; const fetchMyPrograms = async (): Promise => { - const data = await graphqlFetch<{ myPrograms: MyProgram[] | null }>( - MY_PROGRAMS_QUERY, + const data = await graphqlRequest(MY_PROGRAMS_QUERY); + const programs = data.myPrograms ?? []; + return programs.filter( + (program): program is Exclude => program !== null, ); - return data.myPrograms ?? []; }; export const myProgramsQueryOptions = queryOptions({ diff --git a/src/react-app/api/queries/useProgramGatesQuery.spec.ts b/src/react-app/api/queries/useProgramGatesQuery.spec.ts index 32a345f8..dcafb015 100644 --- a/src/react-app/api/queries/useProgramGatesQuery.spec.ts +++ b/src/react-app/api/queries/useProgramGatesQuery.spec.ts @@ -20,9 +20,10 @@ describe("useProgramGatesQuery", () => { }, ]; vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { programGates: mockGates } }), - } as Response); + text: async () => JSON.stringify({ data: { programGates: mockGates } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useProgramGatesQuery("prog-1"), { diff --git a/src/react-app/api/queries/useProgramGatesQuery.ts b/src/react-app/api/queries/useProgramGatesQuery.ts index 5bfbb6a7..b95fb7a7 100644 --- a/src/react-app/api/queries/useProgramGatesQuery.ts +++ b/src/react-app/api/queries/useProgramGatesQuery.ts @@ -1,6 +1,6 @@ import { queryOptions, useQuery } from "@tanstack/react-query"; import { PROGRAM_GATES_QUERY } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { MANAGEMENT_KEYS } from "../queryKeys"; export type GateManagement = { @@ -19,10 +19,7 @@ export type GateManagement = { const fetchProgramGates = async ( programId: string, ): Promise => { - const data = await graphqlFetch<{ programGates: GateManagement[] }>( - PROGRAM_GATES_QUERY, - { programId }, - ); + const data = await graphqlRequest(PROGRAM_GATES_QUERY, { programId }); return data.programGates; }; diff --git a/src/react-app/api/queries/useProgramProgressionQuery.spec.ts b/src/react-app/api/queries/useProgramProgressionQuery.spec.ts index 1bc65a55..3ab51775 100644 --- a/src/react-app/api/queries/useProgramProgressionQuery.spec.ts +++ b/src/react-app/api/queries/useProgramProgressionQuery.spec.ts @@ -19,9 +19,11 @@ describe("programProgressionQueryOptions", () => { status: "in_progress", }; mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { getProgramProgression: progression } }), - } as Response); + text: async () => + JSON.stringify({ data: { getProgramProgression: progression } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook( @@ -44,17 +46,19 @@ describe("programProgressionQueryOptions", () => { it("forwards programId in the query variables", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ - data: { - getProgramProgression: { - currentGate: null, - completedGates: [], - status: "in_progress", + text: async () => + JSON.stringify({ + data: { + getProgramProgression: { + currentGate: null, + completedGates: [], + status: "in_progress", + }, }, - }, - }), - } as Response); + }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); renderHook(() => useQuery(programProgressionQueryOptions(mockProgramId)), { @@ -74,10 +78,11 @@ describe("programProgressionQueryOptions", () => { it("rejects on query error", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: false, status: 500, - json: async () => ({}), - } as Response); + text: async () => JSON.stringify({}), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook( @@ -119,9 +124,11 @@ describe("programProgressionQueryOptions", () => { status: "completed", }; mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { getProgramProgression: progression } }), - } as Response); + text: async () => + JSON.stringify({ data: { getProgramProgression: progression } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook( diff --git a/src/react-app/api/queries/useProgramProgressionQuery.ts b/src/react-app/api/queries/useProgramProgressionQuery.ts index 8c345177..ac9860b3 100644 --- a/src/react-app/api/queries/useProgramProgressionQuery.ts +++ b/src/react-app/api/queries/useProgramProgressionQuery.ts @@ -1,5 +1,5 @@ import { GET_PROGRAM_PROGRESSION_QUERY } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { PROGRAM_KEYS } from "../queryKeys"; export type ActiveGate = { @@ -24,10 +24,10 @@ export type ProgramProgression = { const fetchProgramProgression = async ( programId: string, -): Promise => { - const result = await graphqlFetch<{ - getProgramProgression: ProgramProgression; - }>(GET_PROGRAM_PROGRESSION_QUERY, { programId }); +): Promise => { + const result = await graphqlRequest(GET_PROGRAM_PROGRESSION_QUERY, { + programId, + }); return result.getProgramProgression; }; diff --git a/src/react-app/api/queries/useProgramQuery.spec.ts b/src/react-app/api/queries/useProgramQuery.spec.ts index 93ee09f8..fdb31116 100644 --- a/src/react-app/api/queries/useProgramQuery.spec.ts +++ b/src/react-app/api/queries/useProgramQuery.spec.ts @@ -12,9 +12,10 @@ describe("useProgramQuery", () => { authorId: "user-1", }; vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { program: mockProgram } }), - } as Response); + text: async () => JSON.stringify({ data: { program: mockProgram } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useProgramQuery("prog-1"), { @@ -27,9 +28,10 @@ describe("useProgramQuery", () => { it("returns null when program is not found", async () => { vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { program: null } }), - } as Response); + text: async () => JSON.stringify({ data: { program: null } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useProgramQuery("missing"), { diff --git a/src/react-app/api/queries/useProgramQuery.ts b/src/react-app/api/queries/useProgramQuery.ts index 6c847c93..00b57148 100644 --- a/src/react-app/api/queries/useProgramQuery.ts +++ b/src/react-app/api/queries/useProgramQuery.ts @@ -1,11 +1,10 @@ -import type { Program } from "@shared/types"; import { queryOptions, useQuery } from "@tanstack/react-query"; import { PROGRAM_QUERY } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { PROGRAM_KEYS } from "../queryKeys"; -const fetchProgram = async (id: string): Promise => { - const data = await graphqlFetch<{ program: Program | null }>(PROGRAM_QUERY, { +const fetchProgram = async (id: string) => { + const data = await graphqlRequest(PROGRAM_QUERY, { id, }); return data.program; diff --git a/src/react-app/api/queries/useProgramsQuery.spec.ts b/src/react-app/api/queries/useProgramsQuery.spec.ts index 2f021eab..43500afb 100644 --- a/src/react-app/api/queries/useProgramsQuery.spec.ts +++ b/src/react-app/api/queries/useProgramsQuery.spec.ts @@ -12,9 +12,10 @@ describe("useProgramsQuery", () => { it("fetches and returns programs successfully", async () => { vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { programs: mockPrograms } }), - } as Response); + text: async () => JSON.stringify({ data: { programs: mockPrograms } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); @@ -26,9 +27,11 @@ describe("useProgramsQuery", () => { it("throws an error if the HTTP request fails", async () => { vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: false, status: 500, - } as Response); + text: async () => "", + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useProgramsQuery(), { wrapper }); @@ -41,9 +44,11 @@ describe("useProgramsQuery", () => { it("throws the first GraphQL error message", async () => { vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ errors: [{ message: "Access denied" }] }), - } as Response); + text: async () => + JSON.stringify({ errors: [{ message: "Access denied" }] }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useProgramsQuery(), { wrapper }); @@ -54,20 +59,17 @@ describe("useProgramsQuery", () => { it("throws when response is malformed JSON", async () => { vi.spyOn(globalThis, "fetch").mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, status: 200, - json: async () => { - throw new SyntaxError("Unexpected token <"); - }, + text: async () => "", } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useProgramsQuery(), { wrapper }); await waitFor(() => expect(result.current.isError).toBe(true)); - expect(result.current.error?.message).toBe( - "GraphQL request failed with HTTP 200.", - ); + expect(result.current.error).toBeInstanceOf(SyntaxError); }); it("throws on network failure", async () => { diff --git a/src/react-app/api/queries/useProgramsQuery.ts b/src/react-app/api/queries/useProgramsQuery.ts index d22cecd7..56bd730d 100644 --- a/src/react-app/api/queries/useProgramsQuery.ts +++ b/src/react-app/api/queries/useProgramsQuery.ts @@ -1,11 +1,10 @@ -import type { Program } from "@shared/types"; import { queryOptions, useQuery } from "@tanstack/react-query"; import { GET_PROGRAMS_QUERY } from "../../../shared/gqlQueries"; -import { graphqlFetch } from "../graphQlClient"; +import { graphqlRequest } from "../graphQlClient"; import { PROGRAM_KEYS } from "../queryKeys"; -const fetchPrograms = async (): Promise => { - const data = await graphqlFetch<{ programs: Program[] }>(GET_PROGRAMS_QUERY); +const fetchPrograms = async () => { + const data = await graphqlRequest(GET_PROGRAMS_QUERY); return data.programs; }; diff --git a/src/react-app/hooks/useResetSession.spec.ts b/src/react-app/hooks/useResetSession.spec.ts index 584d7ff0..19012693 100644 --- a/src/react-app/hooks/useResetSession.spec.ts +++ b/src/react-app/hooks/useResetSession.spec.ts @@ -12,9 +12,10 @@ beforeEach(() => { describe("useResetSession", () => { it("returns true on successful reset", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { resetSession: true } }), - } as Response); + text: async () => JSON.stringify({ data: { resetSession: true } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useResetSession(), { wrapper }); @@ -26,9 +27,10 @@ describe("useResetSession", () => { it("sends correct mutation query and variables", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { resetSession: true } }), - } as Response); + text: async () => JSON.stringify({ data: { resetSession: true } }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useResetSession(), { wrapper }); @@ -44,9 +46,10 @@ describe("useResetSession", () => { it("invalidates progression cache on success", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { resetSession: true } }), - } as Response); + text: async () => JSON.stringify({ data: { resetSession: true } }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); @@ -63,10 +66,11 @@ describe("useResetSession", () => { it("invalidates progression cache on mutation failure (onSettled)", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: false, status: 500, - json: async () => ({}), - } as Response); + text: async () => JSON.stringify({}), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); @@ -85,9 +89,10 @@ describe("useResetSession", () => { it("does not invalidate cache when programId is missing", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ data: { resetSession: true } }), - } as Response); + text: async () => JSON.stringify({ data: { resetSession: true } }), + } as unknown as Response); const { queryClient, wrapper } = createQueryWrapper(); const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries"); @@ -101,9 +106,11 @@ describe("useResetSession", () => { it("rejects on GraphQL error response", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: true, - json: async () => ({ errors: [{ message: "Session not found" }] }), - } as Response); + text: async () => + JSON.stringify({ errors: [{ message: "Session not found" }] }), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useResetSession(), { wrapper }); @@ -115,10 +122,11 @@ describe("useResetSession", () => { it("rejects on HTTP failure", async () => { mockFetch.mockResolvedValueOnce({ + headers: { get: () => "application/json" }, ok: false, status: 500, - json: async () => ({}), - } as Response); + text: async () => JSON.stringify({}), + } as unknown as Response); const { wrapper } = createQueryWrapper(); const { result } = renderHook(() => useResetSession(), { wrapper }); diff --git a/src/react-app/hooks/useResetSession.ts b/src/react-app/hooks/useResetSession.ts index 287f82cb..991e3b56 100644 --- a/src/react-app/hooks/useResetSession.ts +++ b/src/react-app/hooks/useResetSession.ts @@ -1,4 +1,4 @@ -import { graphqlFetch } from "@api/graphQlClient"; +import { graphqlRequest } from "@api/graphQlClient"; import { programProgressionQueryOptions } from "@api/queries/useProgramProgressionQuery"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { RESET_SESSION_MUTATION } from "../../shared/gqlQueries"; @@ -12,10 +12,7 @@ export function useResetSession() { return useMutation({ mutationFn: async (variables) => { - const data = await graphqlFetch<{ resetSession: boolean }>( - RESET_SESSION_MUTATION, - variables, - ); + const data = await graphqlRequest(RESET_SESSION_MUTATION, variables); return data.resetSession; }, onSettled: (_data, _error, variables) => { diff --git a/src/shared/generated/graphql.ts b/src/shared/generated/graphql.ts index 7b121fe6..89565e6d 100644 --- a/src/shared/generated/graphql.ts +++ b/src/shared/generated/graphql.ts @@ -2,6 +2,7 @@ type Exact = { [K in keyof T]: T[K] }; /** Internal type. DO NOT USE DIRECTLY. */ export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; /** All built-in and custom scalars, mapped to their actual values */ @@ -20,18 +21,18 @@ export type ActiveGate = { }; export type AiUsageFilters = { - OR: InputMaybe>; - requestCount: InputMaybe; - usageDate: InputMaybe; + OR?: InputMaybe>; + requestCount?: InputMaybe; + usageDate?: InputMaybe; }; export type AiUsageFiltersOr = { - requestCount: InputMaybe; - usageDate: InputMaybe; + requestCount?: InputMaybe; + usageDate?: InputMaybe; }; export type AiUsageInsertInput = { - requestCount: InputMaybe; + requestCount?: InputMaybe; usageDate: Scalars['String']['input']; }; @@ -41,47 +42,47 @@ export type AiUsageItem = { }; export type AiUsageOrderBy = { - requestCount: InputMaybe; - usageDate: InputMaybe; + requestCount?: InputMaybe; + usageDate?: InputMaybe; }; export type AiUsageRequestCountFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type AiUsageRequestCountfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type AiUsageSelectItem = { @@ -90,189 +91,189 @@ export type AiUsageSelectItem = { }; export type AiUsageUpdateInput = { - requestCount: InputMaybe; - usageDate: InputMaybe; + requestCount?: InputMaybe; + usageDate?: InputMaybe; }; export type AiUsageUsageDateFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type AiUsageUsageDatefiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsAttemptCountAtRequestFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsAttemptCountAtRequestfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsFilters = { - OR: InputMaybe>; - attemptCountAtRequest: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - requestedAt: InputMaybe; - sessionProgressId: InputMaybe; + OR?: InputMaybe>; + attemptCountAtRequest?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + requestedAt?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type ClueRateLimitsFiltersOr = { - attemptCountAtRequest: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - requestedAt: InputMaybe; - sessionProgressId: InputMaybe; + attemptCountAtRequest?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + requestedAt?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type ClueRateLimitsGateIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsGateIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsInsertInput = { - attemptCountAtRequest: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; + attemptCountAtRequest?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; /** Date */ - requestedAt: InputMaybe; + requestedAt?: InputMaybe; sessionProgressId: Scalars['String']['input']; }; @@ -286,62 +287,62 @@ export type ClueRateLimitsItem = { }; export type ClueRateLimitsOrderBy = { - attemptCountAtRequest: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - requestedAt: InputMaybe; - sessionProgressId: InputMaybe; + attemptCountAtRequest?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + requestedAt?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type ClueRateLimitsRequestedAtFilters = { - OR: InputMaybe>; + OR?: InputMaybe>; /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsRequestedAtfiltersOr = { /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsSelectItem = { @@ -356,46 +357,46 @@ export type ClueRateLimitsSelectItem = { export type ClueRateLimitsSelectItemSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsSessionProgressIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelation = { @@ -420,36 +421,36 @@ export type ClueRateLimitsSessionProgressRelation = { export type ClueRateLimitsSessionProgressRelationCompletedGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCurrentGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationRateLimitsArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCompletedGatesRelation = { @@ -464,12 +465,12 @@ export type ClueRateLimitsSessionProgressRelationCompletedGatesRelation = { export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelation = { @@ -491,15 +492,15 @@ export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelat export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelationGateCluesRelation = { @@ -516,12 +517,12 @@ export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelat export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelationGateCluesRelationGateRelation = { @@ -566,10 +567,10 @@ export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelat export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCompletedGatesRelationGateRelationProgramRelationGatesRelation = { @@ -621,15 +622,15 @@ export type ClueRateLimitsSessionProgressRelationCurrentGateRelation = { export type ClueRateLimitsSessionProgressRelationCurrentGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCurrentGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCurrentGateRelationGateCluesRelation = { @@ -646,12 +647,12 @@ export type ClueRateLimitsSessionProgressRelationCurrentGateRelationGateCluesRel export type ClueRateLimitsSessionProgressRelationCurrentGateRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCurrentGateRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCurrentGateRelationGateCluesRelationGateRelation = { @@ -696,10 +697,10 @@ export type ClueRateLimitsSessionProgressRelationCurrentGateRelationProgramRelat export type ClueRateLimitsSessionProgressRelationCurrentGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationCurrentGateRelationProgramRelationGatesRelation = { @@ -731,12 +732,12 @@ export type ClueRateLimitsSessionProgressRelationGateCluesRelation = { export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateRelation = { @@ -758,15 +759,15 @@ export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateRelation = export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateRelationGateCluesRelation = { @@ -791,10 +792,10 @@ export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateRelationPr export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationGateCluesRelationGateRelationProgramRelationGatesRelation = { @@ -839,10 +840,10 @@ export type ClueRateLimitsSessionProgressRelationProgramRelation = { export type ClueRateLimitsSessionProgressRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelation = { @@ -864,15 +865,15 @@ export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelation = export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelationGateCluesRelation = { @@ -889,12 +890,12 @@ export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelationGat export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ClueRateLimitsSessionProgressRelationProgramRelationGatesRelationGateCluesRelationGateRelation = { @@ -946,12 +947,12 @@ export type ClueRateLimitsSessionProgressRelationRateLimitsRelation = { }; export type ClueRateLimitsUpdateInput = { - attemptCountAtRequest: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; + attemptCountAtRequest?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; /** Date */ - requestedAt: InputMaybe; - sessionProgressId: InputMaybe; + requestedAt?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type CompletedGate = { @@ -963,190 +964,190 @@ export type CompletedGate = { }; export type GateCluesAttemptCountAtRequestFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesAttemptCountAtRequestfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesClueTextFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesClueTextfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesCreatedAtFilters = { - OR: InputMaybe>; + OR?: InputMaybe>; /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesCreatedAtfiltersOr = { /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesFilters = { - OR: InputMaybe>; - attemptCountAtRequest: InputMaybe; - clueText: InputMaybe; - createdAt: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - sessionProgressId: InputMaybe; + OR?: InputMaybe>; + attemptCountAtRequest?: InputMaybe; + clueText?: InputMaybe; + createdAt?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type GateCluesFiltersOr = { - attemptCountAtRequest: InputMaybe; - clueText: InputMaybe; - createdAt: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - sessionProgressId: InputMaybe; + attemptCountAtRequest?: InputMaybe; + clueText?: InputMaybe; + createdAt?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type GateCluesGateIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesGateIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesGateRelation = { @@ -1168,15 +1169,15 @@ export type GateCluesGateRelation = { export type GateCluesGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesGateRelationGateCluesRelation = { @@ -1201,10 +1202,10 @@ export type GateCluesGateRelationProgramRelation = { export type GateCluesGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesGateRelationProgramRelationGatesRelation = { @@ -1223,51 +1224,51 @@ export type GateCluesGateRelationProgramRelationGatesRelation = { }; export type GateCluesIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesInsertInput = { attemptCountAtRequest: Scalars['Int']['input']; clueText: Scalars['String']['input']; /** Date */ - createdAt: InputMaybe; + createdAt?: InputMaybe; gateId: Scalars['String']['input']; - id: InputMaybe; + id?: InputMaybe; sessionProgressId: Scalars['String']['input']; }; @@ -1282,12 +1283,12 @@ export type GateCluesItem = { }; export type GateCluesOrderBy = { - attemptCountAtRequest: InputMaybe; - clueText: InputMaybe; - createdAt: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - sessionProgressId: InputMaybe; + attemptCountAtRequest?: InputMaybe; + clueText?: InputMaybe; + createdAt?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type GateCluesSelectItem = { @@ -1304,51 +1305,51 @@ export type GateCluesSelectItem = { export type GateCluesSelectItemGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSelectItemSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesSessionProgressIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GateCluesSessionProgressRelation = { @@ -1373,36 +1374,36 @@ export type GateCluesSessionProgressRelation = { export type GateCluesSessionProgressRelationCompletedGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCurrentGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationRateLimitsArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCompletedGatesRelation = { @@ -1417,12 +1418,12 @@ export type GateCluesSessionProgressRelationCompletedGatesRelation = { export type GateCluesSessionProgressRelationCompletedGatesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCompletedGatesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCompletedGatesRelationGateRelation = { @@ -1444,15 +1445,15 @@ export type GateCluesSessionProgressRelationCompletedGatesRelationGateRelation = export type GateCluesSessionProgressRelationCompletedGatesRelationGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCompletedGatesRelationGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCompletedGatesRelationGateRelationGateCluesRelation = { @@ -1477,10 +1478,10 @@ export type GateCluesSessionProgressRelationCompletedGatesRelationGateRelationPr export type GateCluesSessionProgressRelationCompletedGatesRelationGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCompletedGatesRelationGateRelationProgramRelationGatesRelation = { @@ -1532,15 +1533,15 @@ export type GateCluesSessionProgressRelationCurrentGateRelation = { export type GateCluesSessionProgressRelationCurrentGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCurrentGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCurrentGateRelationGateCluesRelation = { @@ -1565,10 +1566,10 @@ export type GateCluesSessionProgressRelationCurrentGateRelationProgramRelation = export type GateCluesSessionProgressRelationCurrentGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationCurrentGateRelationProgramRelationGatesRelation = { @@ -1608,10 +1609,10 @@ export type GateCluesSessionProgressRelationProgramRelation = { export type GateCluesSessionProgressRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationProgramRelationGatesRelation = { @@ -1633,15 +1634,15 @@ export type GateCluesSessionProgressRelationProgramRelationGatesRelation = { export type GateCluesSessionProgressRelationProgramRelationGatesRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationProgramRelationGatesRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationProgramRelationGatesRelationGateCluesRelation = { @@ -1675,7 +1676,7 @@ export type GateCluesSessionProgressRelationRateLimitsRelation = { export type GateCluesSessionProgressRelationRateLimitsRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GateCluesSessionProgressRelationRateLimitsRelationSessionProgressRelation = { @@ -1694,13 +1695,13 @@ export type GateCluesSessionProgressRelationRateLimitsRelationSessionProgressRel }; export type GateCluesUpdateInput = { - attemptCountAtRequest: InputMaybe; - clueText: InputMaybe; + attemptCountAtRequest?: InputMaybe; + clueText?: InputMaybe; /** Date */ - createdAt: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - sessionProgressId: InputMaybe; + createdAt?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type GateManagement = { @@ -1717,161 +1718,161 @@ export type GateManagement = { }; export type GatesAcceptanceThresholdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesAcceptanceThresholdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesCorrectAnswerFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesCorrectAnswerfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesCreatedAtFilters = { - OR: InputMaybe>; + OR?: InputMaybe>; /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesCreatedAtfiltersOr = { /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesFilters = { - OR: InputMaybe>; - acceptanceThreshold: InputMaybe; - correctAnswer: InputMaybe; - createdAt: InputMaybe; - guidanceEnabled: InputMaybe; - guidanceThreshold: InputMaybe; - id: InputMaybe; - label: InputMaybe; - programId: InputMaybe; - question: InputMaybe; - sequenceOrder: InputMaybe; - successMessage: InputMaybe; + OR?: InputMaybe>; + acceptanceThreshold?: InputMaybe; + correctAnswer?: InputMaybe; + createdAt?: InputMaybe; + guidanceEnabled?: InputMaybe; + guidanceThreshold?: InputMaybe; + id?: InputMaybe; + label?: InputMaybe; + programId?: InputMaybe; + question?: InputMaybe; + sequenceOrder?: InputMaybe; + successMessage?: InputMaybe; }; export type GatesFiltersOr = { - acceptanceThreshold: InputMaybe; - correctAnswer: InputMaybe; - createdAt: InputMaybe; - guidanceEnabled: InputMaybe; - guidanceThreshold: InputMaybe; - id: InputMaybe; - label: InputMaybe; - programId: InputMaybe; - question: InputMaybe; - sequenceOrder: InputMaybe; - successMessage: InputMaybe; + acceptanceThreshold?: InputMaybe; + correctAnswer?: InputMaybe; + createdAt?: InputMaybe; + guidanceEnabled?: InputMaybe; + guidanceThreshold?: InputMaybe; + id?: InputMaybe; + label?: InputMaybe; + programId?: InputMaybe; + question?: InputMaybe; + sequenceOrder?: InputMaybe; + successMessage?: InputMaybe; }; export type GatesGateCluesRelation = { @@ -1888,12 +1889,12 @@ export type GatesGateCluesRelation = { export type GatesGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationGateRelation = { @@ -1933,36 +1934,36 @@ export type GatesGateCluesRelationSessionProgressRelation = { export type GatesGateCluesRelationSessionProgressRelationCompletedGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationCurrentGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationRateLimitsArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationCompletedGatesRelation = { @@ -1977,12 +1978,12 @@ export type GatesGateCluesRelationSessionProgressRelationCompletedGatesRelation export type GatesGateCluesRelationSessionProgressRelationCompletedGatesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationCompletedGatesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationCompletedGatesRelationGateRelation = { @@ -2052,10 +2053,10 @@ export type GatesGateCluesRelationSessionProgressRelationProgramRelation = { export type GatesGateCluesRelationSessionProgressRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationProgramRelationGatesRelation = { @@ -2085,7 +2086,7 @@ export type GatesGateCluesRelationSessionProgressRelationRateLimitsRelation = { export type GatesGateCluesRelationSessionProgressRelationRateLimitsRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GatesGateCluesRelationSessionProgressRelationRateLimitsRelationSessionProgressRelation = { @@ -2104,134 +2105,134 @@ export type GatesGateCluesRelationSessionProgressRelationRateLimitsRelationSessi }; export type GatesGuidanceEnabledFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesGuidanceEnabledfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesGuidanceThresholdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesGuidanceThresholdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesInsertInput = { - acceptanceThreshold: InputMaybe; + acceptanceThreshold?: InputMaybe; correctAnswer: Scalars['String']['input']; /** Date */ - createdAt: InputMaybe; - guidanceEnabled: InputMaybe; - guidanceThreshold: InputMaybe; - id: InputMaybe; + createdAt?: InputMaybe; + guidanceEnabled?: InputMaybe; + guidanceThreshold?: InputMaybe; + id?: InputMaybe; label: Scalars['String']['input']; programId: Scalars['String']['input']; question: Scalars['String']['input']; - sequenceOrder: InputMaybe; + sequenceOrder?: InputMaybe; successMessage: Scalars['String']['input']; }; @@ -2251,95 +2252,95 @@ export type GatesItem = { }; export type GatesLabelFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesLabelfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesOrderBy = { - acceptanceThreshold: InputMaybe; - correctAnswer: InputMaybe; - createdAt: InputMaybe; - guidanceEnabled: InputMaybe; - guidanceThreshold: InputMaybe; - id: InputMaybe; - label: InputMaybe; - programId: InputMaybe; - question: InputMaybe; - sequenceOrder: InputMaybe; - successMessage: InputMaybe; + acceptanceThreshold?: InputMaybe; + correctAnswer?: InputMaybe; + createdAt?: InputMaybe; + guidanceEnabled?: InputMaybe; + guidanceThreshold?: InputMaybe; + id?: InputMaybe; + label?: InputMaybe; + programId?: InputMaybe; + question?: InputMaybe; + sequenceOrder?: InputMaybe; + successMessage?: InputMaybe; }; export type GatesProgramIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesProgramIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesProgramRelation = { @@ -2354,10 +2355,10 @@ export type GatesProgramRelation = { export type GatesProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GatesProgramRelationGatesRelation = { @@ -2376,42 +2377,42 @@ export type GatesProgramRelationGatesRelation = { }; export type GatesQuestionFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesQuestionfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesSelectItem = { @@ -2433,108 +2434,108 @@ export type GatesSelectItem = { export type GatesSelectItemGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type GatesSelectItemProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type GatesSequenceOrderFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesSequenceOrderfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesSuccessMessageFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesSuccessMessagefiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type GatesUpdateInput = { - acceptanceThreshold: InputMaybe; - correctAnswer: InputMaybe; + acceptanceThreshold?: InputMaybe; + correctAnswer?: InputMaybe; /** Date */ - createdAt: InputMaybe; - guidanceEnabled: InputMaybe; - guidanceThreshold: InputMaybe; - id: InputMaybe; - label: InputMaybe; - programId: InputMaybe; - question: InputMaybe; - sequenceOrder: InputMaybe; - successMessage: InputMaybe; + createdAt?: InputMaybe; + guidanceEnabled?: InputMaybe; + guidanceThreshold?: InputMaybe; + id?: InputMaybe; + label?: InputMaybe; + programId?: InputMaybe; + question?: InputMaybe; + sequenceOrder?: InputMaybe; + successMessage?: InputMaybe; }; export type InnerOrder = { @@ -2565,10 +2566,10 @@ export type Mutation = { export type MutationCreateGateArgs = { - acceptanceThreshold: InputMaybe; + acceptanceThreshold?: InputMaybe; correctAnswer: Scalars['String']['input']; - guidanceEnabled: InputMaybe; - guidanceThreshold: InputMaybe; + guidanceEnabled?: InputMaybe; + guidanceThreshold?: InputMaybe; label: Scalars['String']['input']; programId: Scalars['String']['input']; question: Scalars['String']['input']; @@ -2579,7 +2580,7 @@ export type MutationCreateGateArgs = { export type MutationCreateProgramArgs = { name: Scalars['String']['input']; - visibility: InputMaybe; + visibility?: InputMaybe; }; @@ -2619,22 +2620,22 @@ export type MutationSubmitGuessArgs = { export type MutationUpdateGateArgs = { - acceptanceThreshold: InputMaybe; - correctAnswer: InputMaybe; - guidanceEnabled: InputMaybe; - guidanceThreshold: InputMaybe; + acceptanceThreshold?: InputMaybe; + correctAnswer?: InputMaybe; + guidanceEnabled?: InputMaybe; + guidanceThreshold?: InputMaybe; id: Scalars['String']['input']; - label: InputMaybe; - question: InputMaybe; - sequenceOrder: InputMaybe; - successMessage: InputMaybe; + label?: InputMaybe; + question?: InputMaybe; + sequenceOrder?: InputMaybe; + successMessage?: InputMaybe; }; export type MutationUpdateProgramArgs = { id: Scalars['String']['input']; - name: InputMaybe; - visibility: InputMaybe; + name?: InputMaybe; + visibility?: InputMaybe; }; /** Order by direction */ @@ -2661,110 +2662,110 @@ export type ProgramManagement = { }; export type ProgramsAuthorIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsAuthorIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsCreatedAtFilters = { - OR: InputMaybe>; + OR?: InputMaybe>; /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsCreatedAtfiltersOr = { /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsFilters = { - OR: InputMaybe>; - authorId: InputMaybe; - createdAt: InputMaybe; - id: InputMaybe; - name: InputMaybe; - visibility: InputMaybe; + OR?: InputMaybe>; + authorId?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + visibility?: InputMaybe; }; export type ProgramsFiltersOr = { - authorId: InputMaybe; - createdAt: InputMaybe; - id: InputMaybe; - name: InputMaybe; - visibility: InputMaybe; + authorId?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + visibility?: InputMaybe; }; export type ProgramsGatesRelation = { @@ -2786,15 +2787,15 @@ export type ProgramsGatesRelation = { export type ProgramsGatesRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelation = { @@ -2811,12 +2812,12 @@ export type ProgramsGatesRelationGateCluesRelation = { export type ProgramsGatesRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationGateRelation = { @@ -2856,36 +2857,36 @@ export type ProgramsGatesRelationGateCluesRelationSessionProgressRelation = { export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationCompletedGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationCurrentGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationRateLimitsArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationCompletedGatesRelation = { @@ -2900,12 +2901,12 @@ export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationComplet export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationCompletedGatesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationCompletedGatesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationCompletedGatesRelationGateRelation = { @@ -2984,7 +2985,7 @@ export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationRateLim export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationRateLimitsRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type ProgramsGatesRelationGateCluesRelationSessionProgressRelationRateLimitsRelationSessionProgressRelation = { @@ -3012,51 +3013,51 @@ export type ProgramsGatesRelationProgramRelation = { }; export type ProgramsIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsInsertInput = { - authorId: InputMaybe; + authorId?: InputMaybe; /** Date */ - createdAt: InputMaybe; - id: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; name: Scalars['String']['input']; - visibility: InputMaybe; + visibility?: InputMaybe; }; export type ProgramsItem = { @@ -3069,50 +3070,50 @@ export type ProgramsItem = { }; export type ProgramsNameFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsNamefiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsOrderBy = { - authorId: InputMaybe; - createdAt: InputMaybe; - id: InputMaybe; - name: InputMaybe; - visibility: InputMaybe; + authorId?: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + visibility?: InputMaybe; }; export type ProgramsSelectItem = { @@ -3127,58 +3128,58 @@ export type ProgramsSelectItem = { export type ProgramsSelectItemGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type ProgramsUpdateInput = { - authorId: InputMaybe; + authorId?: InputMaybe; /** Date */ - createdAt: InputMaybe; - id: InputMaybe; - name: InputMaybe; - visibility: InputMaybe; + createdAt?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + visibility?: InputMaybe; }; export type ProgramsVisibilityFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgramsVisibilityfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type ProgressionPayload = { @@ -3222,108 +3223,108 @@ export type RequestClueResult = { }; export type SessionCompletedGatesCompletedAtFilters = { - OR: InputMaybe>; + OR?: InputMaybe>; /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionCompletedGatesCompletedAtfiltersOr = { /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionCompletedGatesFilters = { - OR: InputMaybe>; - completedAt: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - sessionProgressId: InputMaybe; + OR?: InputMaybe>; + completedAt?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type SessionCompletedGatesFiltersOr = { - completedAt: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - sessionProgressId: InputMaybe; + completedAt?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type SessionCompletedGatesGateIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionCompletedGatesGateIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionCompletedGatesGateRelation = { @@ -3345,15 +3346,15 @@ export type SessionCompletedGatesGateRelation = { export type SessionCompletedGatesGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelation = { @@ -3370,12 +3371,12 @@ export type SessionCompletedGatesGateRelationGateCluesRelation = { export type SessionCompletedGatesGateRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationGateRelation = { @@ -3415,36 +3416,36 @@ export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRel export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationCompletedGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationCurrentGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationRateLimitsArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationCompletedGatesRelation = { @@ -3492,10 +3493,10 @@ export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRel export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationProgramRelationGatesRelation = { @@ -3525,7 +3526,7 @@ export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRel export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationRateLimitsRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationGateCluesRelationSessionProgressRelationRateLimitsRelationSessionProgressRelation = { @@ -3555,10 +3556,10 @@ export type SessionCompletedGatesGateRelationProgramRelation = { export type SessionCompletedGatesGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesGateRelationProgramRelationGatesRelation = { @@ -3577,49 +3578,49 @@ export type SessionCompletedGatesGateRelationProgramRelationGatesRelation = { }; export type SessionCompletedGatesIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionCompletedGatesIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionCompletedGatesInsertInput = { /** Date */ - completedAt: InputMaybe; + completedAt?: InputMaybe; gateId: Scalars['String']['input']; - id: InputMaybe; + id?: InputMaybe; sessionProgressId: Scalars['String']['input']; }; @@ -3632,10 +3633,10 @@ export type SessionCompletedGatesItem = { }; export type SessionCompletedGatesOrderBy = { - completedAt: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - sessionProgressId: InputMaybe; + completedAt?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type SessionCompletedGatesSelectItem = { @@ -3650,51 +3651,51 @@ export type SessionCompletedGatesSelectItem = { export type SessionCompletedGatesSelectItemGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSelectItemSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionCompletedGatesSessionProgressIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelation = { @@ -3719,36 +3720,36 @@ export type SessionCompletedGatesSessionProgressRelation = { export type SessionCompletedGatesSessionProgressRelationCompletedGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationCurrentGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationRateLimitsArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationCompletedGatesRelation = { @@ -3778,15 +3779,15 @@ export type SessionCompletedGatesSessionProgressRelationCurrentGateRelation = { export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationGateCluesRelation = { @@ -3803,12 +3804,12 @@ export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationGateC export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationGateCluesRelationGateRelation = { @@ -3853,10 +3854,10 @@ export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationProgr export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationCurrentGateRelationProgramRelationGatesRelation = { @@ -3888,12 +3889,12 @@ export type SessionCompletedGatesSessionProgressRelationGateCluesRelation = { export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateRelation = { @@ -3915,15 +3916,15 @@ export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateRel export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateRelationGateCluesRelation = { @@ -3948,10 +3949,10 @@ export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateRel export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationGateCluesRelationGateRelationProgramRelationGatesRelation = { @@ -3996,10 +3997,10 @@ export type SessionCompletedGatesSessionProgressRelationProgramRelation = { export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRelation = { @@ -4021,15 +4022,15 @@ export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRela export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRelationGateCluesRelation = { @@ -4046,12 +4047,12 @@ export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRela export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationProgramRelationGatesRelationGateCluesRelationGateRelation = { @@ -4105,7 +4106,7 @@ export type SessionCompletedGatesSessionProgressRelationRateLimitsRelation = { export type SessionCompletedGatesSessionProgressRelationRateLimitsRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionCompletedGatesSessionProgressRelationRateLimitsRelationSessionProgressRelation = { @@ -4125,100 +4126,100 @@ export type SessionCompletedGatesSessionProgressRelationRateLimitsRelationSessio export type SessionCompletedGatesUpdateInput = { /** Date */ - completedAt: InputMaybe; - gateId: InputMaybe; - id: InputMaybe; - sessionProgressId: InputMaybe; + completedAt?: InputMaybe; + gateId?: InputMaybe; + id?: InputMaybe; + sessionProgressId?: InputMaybe; }; export type SessionProgressAttemptCountFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressAttemptCountfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressCompletedAtFilters = { - OR: InputMaybe>; + OR?: InputMaybe>; /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressCompletedAtfiltersOr = { /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressCompletedGatesRelation = { @@ -4233,12 +4234,12 @@ export type SessionProgressCompletedGatesRelation = { export type SessionProgressCompletedGatesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCompletedGatesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCompletedGatesRelationGateRelation = { @@ -4260,15 +4261,15 @@ export type SessionProgressCompletedGatesRelationGateRelation = { export type SessionProgressCompletedGatesRelationGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCompletedGatesRelationGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCompletedGatesRelationGateRelationGateCluesRelation = { @@ -4285,12 +4286,12 @@ export type SessionProgressCompletedGatesRelationGateRelationGateCluesRelation = export type SessionProgressCompletedGatesRelationGateRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCompletedGatesRelationGateRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCompletedGatesRelationGateRelationGateCluesRelationGateRelation = { @@ -4335,10 +4336,10 @@ export type SessionProgressCompletedGatesRelationGateRelationProgramRelation = { export type SessionProgressCompletedGatesRelationGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCompletedGatesRelationGateRelationProgramRelationGatesRelation = { @@ -4372,42 +4373,42 @@ export type SessionProgressCompletedGatesRelationSessionProgressRelation = { }; export type SessionProgressCurrentGateIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressCurrentGateIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressCurrentGateRelation = { @@ -4429,15 +4430,15 @@ export type SessionProgressCurrentGateRelation = { export type SessionProgressCurrentGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCurrentGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCurrentGateRelationGateCluesRelation = { @@ -4454,12 +4455,12 @@ export type SessionProgressCurrentGateRelationGateCluesRelation = { export type SessionProgressCurrentGateRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCurrentGateRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCurrentGateRelationGateCluesRelationGateRelation = { @@ -4504,10 +4505,10 @@ export type SessionProgressCurrentGateRelationProgramRelation = { export type SessionProgressCurrentGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressCurrentGateRelationProgramRelationGatesRelation = { @@ -4526,28 +4527,28 @@ export type SessionProgressCurrentGateRelationProgramRelationGatesRelation = { }; export type SessionProgressFilters = { - OR: InputMaybe>; - attemptCount: InputMaybe; - completedAt: InputMaybe; - currentGateId: InputMaybe; - id: InputMaybe; - programId: InputMaybe; - sessionId: InputMaybe; - startedAt: InputMaybe; - status: InputMaybe; - updatedAt: InputMaybe; + OR?: InputMaybe>; + attemptCount?: InputMaybe; + completedAt?: InputMaybe; + currentGateId?: InputMaybe; + id?: InputMaybe; + programId?: InputMaybe; + sessionId?: InputMaybe; + startedAt?: InputMaybe; + status?: InputMaybe; + updatedAt?: InputMaybe; }; export type SessionProgressFiltersOr = { - attemptCount: InputMaybe; - completedAt: InputMaybe; - currentGateId: InputMaybe; - id: InputMaybe; - programId: InputMaybe; - sessionId: InputMaybe; - startedAt: InputMaybe; - status: InputMaybe; - updatedAt: InputMaybe; + attemptCount?: InputMaybe; + completedAt?: InputMaybe; + currentGateId?: InputMaybe; + id?: InputMaybe; + programId?: InputMaybe; + sessionId?: InputMaybe; + startedAt?: InputMaybe; + status?: InputMaybe; + updatedAt?: InputMaybe; }; export type SessionProgressGateCluesRelation = { @@ -4564,12 +4565,12 @@ export type SessionProgressGateCluesRelation = { export type SessionProgressGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressGateCluesRelationGateRelation = { @@ -4591,15 +4592,15 @@ export type SessionProgressGateCluesRelationGateRelation = { export type SessionProgressGateCluesRelationGateRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressGateCluesRelationGateRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressGateCluesRelationGateRelationGateCluesRelation = { @@ -4624,10 +4625,10 @@ export type SessionProgressGateCluesRelationGateRelationProgramRelation = { export type SessionProgressGateCluesRelationGateRelationProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressGateCluesRelationGateRelationProgramRelationGatesRelation = { @@ -4661,57 +4662,57 @@ export type SessionProgressGateCluesRelationSessionProgressRelation = { }; export type SessionProgressIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressInsertInput = { - attemptCount: InputMaybe; + attemptCount?: InputMaybe; /** Date */ - completedAt: InputMaybe; - currentGateId: InputMaybe; - id: InputMaybe; + completedAt?: InputMaybe; + currentGateId?: InputMaybe; + id?: InputMaybe; programId: Scalars['String']['input']; sessionId: Scalars['String']['input']; /** Date */ - startedAt: InputMaybe; - status: InputMaybe; + startedAt?: InputMaybe; + status?: InputMaybe; /** Date */ - updatedAt: InputMaybe; + updatedAt?: InputMaybe; }; export type SessionProgressItem = { @@ -4730,54 +4731,54 @@ export type SessionProgressItem = { }; export type SessionProgressOrderBy = { - attemptCount: InputMaybe; - completedAt: InputMaybe; - currentGateId: InputMaybe; - id: InputMaybe; - programId: InputMaybe; - sessionId: InputMaybe; - startedAt: InputMaybe; - status: InputMaybe; - updatedAt: InputMaybe; + attemptCount?: InputMaybe; + completedAt?: InputMaybe; + currentGateId?: InputMaybe; + id?: InputMaybe; + programId?: InputMaybe; + sessionId?: InputMaybe; + startedAt?: InputMaybe; + status?: InputMaybe; + updatedAt?: InputMaybe; }; export type SessionProgressProgramIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressProgramIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressProgramRelation = { @@ -4792,10 +4793,10 @@ export type SessionProgressProgramRelation = { export type SessionProgressProgramRelationGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressProgramRelationGatesRelation = { @@ -4817,15 +4818,15 @@ export type SessionProgressProgramRelationGatesRelation = { export type SessionProgressProgramRelationGatesRelationGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressProgramRelationGatesRelationProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressProgramRelationGatesRelationGateCluesRelation = { @@ -4842,12 +4843,12 @@ export type SessionProgressProgramRelationGatesRelationGateCluesRelation = { export type SessionProgressProgramRelationGatesRelationGateCluesRelationGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressProgramRelationGatesRelationGateCluesRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressProgramRelationGatesRelationGateCluesRelationGateRelation = { @@ -4901,7 +4902,7 @@ export type SessionProgressRateLimitsRelation = { export type SessionProgressRateLimitsRelationSessionProgressArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressRateLimitsRelationSessionProgressRelation = { @@ -4941,231 +4942,231 @@ export type SessionProgressSelectItem = { export type SessionProgressSelectItemCompletedGatesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressSelectItemCurrentGateArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressSelectItemGateCluesArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressSelectItemProgramArgs = { - where: InputMaybe; + where?: InputMaybe; }; export type SessionProgressSelectItemRateLimitsArgs = { - limit: InputMaybe; - offset: InputMaybe; - orderBy: InputMaybe; - where: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe; + where?: InputMaybe; }; export type SessionProgressSessionIdFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressSessionIdfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressStartedAtFilters = { - OR: InputMaybe>; + OR?: InputMaybe>; /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressStartedAtfiltersOr = { /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressStatusFilters = { - OR: InputMaybe>; - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + OR?: InputMaybe>; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressStatusfiltersOr = { - eq: InputMaybe; - gt: InputMaybe; - gte: InputMaybe; - ilike: InputMaybe; + eq?: InputMaybe; + gt?: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; - lt: InputMaybe; - lte: InputMaybe; - ne: InputMaybe; - notIlike: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; + lt?: InputMaybe; + lte?: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressUpdateInput = { - attemptCount: InputMaybe; + attemptCount?: InputMaybe; /** Date */ - completedAt: InputMaybe; - currentGateId: InputMaybe; - id: InputMaybe; - programId: InputMaybe; - sessionId: InputMaybe; + completedAt?: InputMaybe; + currentGateId?: InputMaybe; + id?: InputMaybe; + programId?: InputMaybe; + sessionId?: InputMaybe; /** Date */ - startedAt: InputMaybe; - status: InputMaybe; + startedAt?: InputMaybe; + status?: InputMaybe; /** Date */ - updatedAt: InputMaybe; + updatedAt?: InputMaybe; }; export type SessionProgressUpdatedAtFilters = { - OR: InputMaybe>; + OR?: InputMaybe>; /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SessionProgressUpdatedAtfiltersOr = { /** Date */ - eq: InputMaybe; + eq?: InputMaybe; /** Date */ - gt: InputMaybe; + gt?: InputMaybe; /** Date */ - gte: InputMaybe; - ilike: InputMaybe; + gte?: InputMaybe; + ilike?: InputMaybe; /** Array */ - inArray: InputMaybe>; - isNotNull: InputMaybe; - isNull: InputMaybe; - like: InputMaybe; + inArray?: InputMaybe>; + isNotNull?: InputMaybe; + isNull?: InputMaybe; + like?: InputMaybe; /** Date */ - lt: InputMaybe; + lt?: InputMaybe; /** Date */ - lte: InputMaybe; + lte?: InputMaybe; /** Date */ - ne: InputMaybe; - notIlike: InputMaybe; + ne?: InputMaybe; + notIlike?: InputMaybe; /** Array */ - notInArray: InputMaybe>; - notLike: InputMaybe; + notInArray?: InputMaybe>; + notLike?: InputMaybe; }; export type SubmitGuessPayload = { @@ -5243,7 +5244,7 @@ export type MeQuery = { me: { id: string, email: string, name: string, image: st export type CreateProgramMutationVariables = Exact<{ name: string; - visibility: string | null | undefined; + visibility?: string | null | undefined; }>; @@ -5251,8 +5252,8 @@ export type CreateProgramMutation = { createProgram: { id: string, name: string, export type UpdateProgramMutationVariables = Exact<{ id: string; - name: string | null | undefined; - visibility: string | null | undefined; + name?: string | null | undefined; + visibility?: string | null | undefined; }>; @@ -5272,9 +5273,9 @@ export type CreateGateMutationVariables = Exact<{ correctAnswer: string; successMessage: string; sequenceOrder: number; - acceptanceThreshold: number | null | undefined; - guidanceEnabled: boolean | null | undefined; - guidanceThreshold: number | null | undefined; + acceptanceThreshold?: number | null | undefined; + guidanceEnabled?: boolean | null | undefined; + guidanceThreshold?: number | null | undefined; }>; @@ -5282,14 +5283,14 @@ export type CreateGateMutation = { createGate: { id: string, programId: string, export type UpdateGateMutationVariables = Exact<{ id: string; - label: string | null | undefined; - question: string | null | undefined; - correctAnswer: string | null | undefined; - successMessage: string | null | undefined; - sequenceOrder: number | null | undefined; - acceptanceThreshold: number | null | undefined; - guidanceEnabled: boolean | null | undefined; - guidanceThreshold: number | null | undefined; + label?: string | null | undefined; + question?: string | null | undefined; + correctAnswer?: string | null | undefined; + successMessage?: string | null | undefined; + sequenceOrder?: number | null | undefined; + acceptanceThreshold?: number | null | undefined; + guidanceEnabled?: boolean | null | undefined; + guidanceThreshold?: number | null | undefined; }>; @@ -5309,3 +5310,22 @@ export type ReorderGatesMutationVariables = Exact<{ export type ReorderGatesMutation = { reorderGates: boolean }; + + +export const SubmitGuessDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SubmitGuess"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"programId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gateId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"guess"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"submitGuess"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"programId"}}},{"kind":"Argument","name":{"kind":"Name","value":"gateId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gateId"}}},{"kind":"Argument","name":{"kind":"Name","value":"guess"},"value":{"kind":"Variable","name":{"kind":"Name","value":"guess"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"canRequestClue"}},{"kind":"Field","name":{"kind":"Name","value":"nextGate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"question"}}]}}]}}]}}]} as unknown as DocumentNode; +export const RequestClueDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RequestClue"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"programId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gateId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentGuess"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"requestClue"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"programId"}}},{"kind":"Argument","name":{"kind":"Name","value":"gateId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gateId"}}},{"kind":"Argument","name":{"kind":"Name","value":"currentGuess"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentGuess"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"clueText"}},{"kind":"Field","name":{"kind":"Name","value":"isClueLimitReached"}},{"kind":"Field","name":{"kind":"Name","value":"cluesRemaining"}},{"kind":"Field","name":{"kind":"Name","value":"isRateLimited"}},{"kind":"Field","name":{"kind":"Name","value":"retryAfterMs"}},{"kind":"Field","name":{"kind":"Name","value":"isAiBudgetExhausted"}}]}}]}}]} as unknown as DocumentNode; +export const ResetSessionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetSession"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"programId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetSession"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"programId"}}}]}]}}]} as unknown as DocumentNode; +export const GetProgramsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPrograms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"programs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const GetProgramProgressionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProgramProgression"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"programId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getProgramProgression"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"programId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentGate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"question"}}]}},{"kind":"Field","name":{"kind":"Name","value":"completedGates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"question"}},{"kind":"Field","name":{"kind":"Name","value":"correctAnswer"}},{"kind":"Field","name":{"kind":"Name","value":"successMessage"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode; +export const GetInProgressProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInProgressProgram"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getInProgressProgram"}}]}}]} as unknown as DocumentNode; +export const ProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Program"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"program"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const ProgramGatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProgramGates"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"programId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"programGates"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"programId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"programId"}},{"kind":"Field","name":{"kind":"Name","value":"sequenceOrder"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"question"}},{"kind":"Field","name":{"kind":"Name","value":"correctAnswer"}},{"kind":"Field","name":{"kind":"Name","value":"successMessage"}},{"kind":"Field","name":{"kind":"Name","value":"acceptanceThreshold"}},{"kind":"Field","name":{"kind":"Name","value":"guidanceEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"guidanceThreshold"}}]}}]}}]} as unknown as DocumentNode; +export const MyProgramsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MyPrograms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"myPrograms"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"authorId"}}]}}]}}]} as unknown as DocumentNode; +export const MeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"image"}}]}}]}}]} as unknown as DocumentNode; +export const CreateProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateProgram"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"visibility"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createProgram"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"visibility"},"value":{"kind":"Variable","name":{"kind":"Name","value":"visibility"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"authorId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]} as unknown as DocumentNode; +export const UpdateProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateProgram"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"visibility"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateProgram"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"visibility"},"value":{"kind":"Variable","name":{"kind":"Name","value":"visibility"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}}]}}]}}]} as unknown as DocumentNode; +export const DeleteProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteProgram"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteProgram"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}]} as unknown as DocumentNode; +export const CreateGateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateGate"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"programId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"label"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"question"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"correctAnswer"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"successMessage"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sequenceOrder"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"acceptanceThreshold"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"guidanceEnabled"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"guidanceThreshold"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createGate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"programId"}}},{"kind":"Argument","name":{"kind":"Name","value":"label"},"value":{"kind":"Variable","name":{"kind":"Name","value":"label"}}},{"kind":"Argument","name":{"kind":"Name","value":"question"},"value":{"kind":"Variable","name":{"kind":"Name","value":"question"}}},{"kind":"Argument","name":{"kind":"Name","value":"correctAnswer"},"value":{"kind":"Variable","name":{"kind":"Name","value":"correctAnswer"}}},{"kind":"Argument","name":{"kind":"Name","value":"successMessage"},"value":{"kind":"Variable","name":{"kind":"Name","value":"successMessage"}}},{"kind":"Argument","name":{"kind":"Name","value":"sequenceOrder"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sequenceOrder"}}},{"kind":"Argument","name":{"kind":"Name","value":"acceptanceThreshold"},"value":{"kind":"Variable","name":{"kind":"Name","value":"acceptanceThreshold"}}},{"kind":"Argument","name":{"kind":"Name","value":"guidanceEnabled"},"value":{"kind":"Variable","name":{"kind":"Name","value":"guidanceEnabled"}}},{"kind":"Argument","name":{"kind":"Name","value":"guidanceThreshold"},"value":{"kind":"Variable","name":{"kind":"Name","value":"guidanceThreshold"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"programId"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"question"}},{"kind":"Field","name":{"kind":"Name","value":"sequenceOrder"}}]}}]}}]} as unknown as DocumentNode; +export const UpdateGateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateGate"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"label"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"question"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"correctAnswer"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"successMessage"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sequenceOrder"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"acceptanceThreshold"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"guidanceEnabled"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"guidanceThreshold"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateGate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"label"},"value":{"kind":"Variable","name":{"kind":"Name","value":"label"}}},{"kind":"Argument","name":{"kind":"Name","value":"question"},"value":{"kind":"Variable","name":{"kind":"Name","value":"question"}}},{"kind":"Argument","name":{"kind":"Name","value":"correctAnswer"},"value":{"kind":"Variable","name":{"kind":"Name","value":"correctAnswer"}}},{"kind":"Argument","name":{"kind":"Name","value":"successMessage"},"value":{"kind":"Variable","name":{"kind":"Name","value":"successMessage"}}},{"kind":"Argument","name":{"kind":"Name","value":"sequenceOrder"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sequenceOrder"}}},{"kind":"Argument","name":{"kind":"Name","value":"acceptanceThreshold"},"value":{"kind":"Variable","name":{"kind":"Name","value":"acceptanceThreshold"}}},{"kind":"Argument","name":{"kind":"Name","value":"guidanceEnabled"},"value":{"kind":"Variable","name":{"kind":"Name","value":"guidanceEnabled"}}},{"kind":"Argument","name":{"kind":"Name","value":"guidanceThreshold"},"value":{"kind":"Variable","name":{"kind":"Name","value":"guidanceThreshold"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"sequenceOrder"}}]}}]}}]} as unknown as DocumentNode; +export const DeleteGateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteGate"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteGate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}]} as unknown as DocumentNode; +export const ReorderGatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ReorderGates"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"programId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderedGateIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"reorderGates"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"programId"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderedGateIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderedGateIds"}}}]}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/src/shared/gqlQueries.ts b/src/shared/gqlQueries.ts index bb399729..61091c73 100644 --- a/src/shared/gqlQueries.ts +++ b/src/shared/gqlQueries.ts @@ -1,11 +1,38 @@ /** - * Single source of truth for all GraphQL query/mutation strings. + * Single source of truth for GraphQL query/mutation operations. * - * Frontend hooks/api files and backend integration tests both import - * from here. Never define query strings inline in consumer files. + * The hand-written GraphQL operation strings below are the input for + * graphql-codegen (typed-document-node), which validates them against + * `graphql/schema.graphql` and emits fully typed `*Document` constants + * (TypedDocumentNode) in `./generated/graphql.ts`. + * + * Those generated constants are re-exported here as the runtime API consumed + * by hooks/api files and integration tests. Edit an operation string below, + * then run `bun run gql:generate` and commit the regenerated output so the + * exported documents stay in sync. */ -export const SUBMIT_GUESS_MUTATION = +import { + CreateGateDocument, + CreateProgramDocument, + DeleteGateDocument, + DeleteProgramDocument, + GetInProgressProgramDocument, + GetProgramProgressionDocument, + GetProgramsDocument, + MeDocument, + MyProgramsDocument, + ProgramDocument, + ProgramGatesDocument, + ReorderGatesDocument, + RequestClueDocument, + ResetSessionDocument, + SubmitGuessDocument, + UpdateGateDocument, + UpdateProgramDocument, +} from "./generated/graphql"; + +export const SUBMIT_GUESS_MUTATION_OPERATION = /* GraphQL */ ` mutation SubmitGuess($programId: String!, $gateId: String!, $guess: String!) { @@ -22,7 +49,7 @@ export const SUBMIT_GUESS_MUTATION = } `; -export const REQUEST_CLUE_MUTATION = +export const REQUEST_CLUE_MUTATION_OPERATION = /* GraphQL */ ` mutation RequestClue($programId: String!, $gateId: String!, $currentGuess: String!) { @@ -37,7 +64,7 @@ export const REQUEST_CLUE_MUTATION = } `; -export const RESET_SESSION_MUTATION = +export const RESET_SESSION_MUTATION_OPERATION = /* GraphQL */ ` mutation ResetSession($programId: String!) { @@ -45,7 +72,7 @@ export const RESET_SESSION_MUTATION = } `; -export const GET_PROGRAMS_QUERY = +export const GET_PROGRAMS_QUERY_OPERATION = /* GraphQL */ ` query GetPrograms { @@ -56,7 +83,7 @@ export const GET_PROGRAMS_QUERY = } `; -export const GET_PROGRAM_PROGRESSION_QUERY = +export const GET_PROGRAM_PROGRESSION_QUERY_OPERATION = /* GraphQL */ ` query GetProgramProgression($programId: String!) { @@ -78,7 +105,7 @@ export const GET_PROGRAM_PROGRESSION_QUERY = } `; -export const GET_IN_PROGRESS_PROGRAM_QUERY = +export const GET_IN_PROGRESS_PROGRAM_QUERY_OPERATION = /* GraphQL */ ` query GetInProgressProgram { @@ -86,7 +113,7 @@ export const GET_IN_PROGRESS_PROGRAM_QUERY = } `; -export const PROGRAM_QUERY = +export const PROGRAM_QUERY_OPERATION = /* GraphQL */ ` query Program($id: String!) { @@ -97,7 +124,7 @@ export const PROGRAM_QUERY = } `; -export const PROGRAM_GATES_QUERY = +export const PROGRAM_GATES_QUERY_OPERATION = /* GraphQL */ ` query ProgramGates($programId: String!) { @@ -116,7 +143,7 @@ export const PROGRAM_GATES_QUERY = } `; -export const MY_PROGRAMS_QUERY = +export const MY_PROGRAMS_QUERY_OPERATION = /* GraphQL */ ` query MyPrograms { @@ -129,7 +156,7 @@ export const MY_PROGRAMS_QUERY = } `; -export const ME_QUERY = +export const ME_QUERY_OPERATION = /* GraphQL */ ` query Me { @@ -142,7 +169,7 @@ export const ME_QUERY = } `; -export const CREATE_PROGRAM_MUTATION = +export const CREATE_PROGRAM_MUTATION_OPERATION = /* GraphQL */ ` mutation CreateProgram($name: String!, $visibility: String) { @@ -156,7 +183,7 @@ export const CREATE_PROGRAM_MUTATION = } `; -export const UPDATE_PROGRAM_MUTATION = +export const UPDATE_PROGRAM_MUTATION_OPERATION = /* GraphQL */ ` mutation UpdateProgram($id: String!, $name: String, $visibility: String) { @@ -168,7 +195,7 @@ export const UPDATE_PROGRAM_MUTATION = } `; -export const DELETE_PROGRAM_MUTATION = +export const DELETE_PROGRAM_MUTATION_OPERATION = /* GraphQL */ ` mutation DeleteProgram($id: String!) { @@ -176,7 +203,7 @@ export const DELETE_PROGRAM_MUTATION = } `; -export const CREATE_GATE_MUTATION = +export const CREATE_GATE_MUTATION_OPERATION = /* GraphQL */ ` mutation CreateGate( @@ -210,7 +237,7 @@ export const CREATE_GATE_MUTATION = } `; -export const UPDATE_GATE_MUTATION = +export const UPDATE_GATE_MUTATION_OPERATION = /* GraphQL */ ` mutation UpdateGate( @@ -242,7 +269,7 @@ export const UPDATE_GATE_MUTATION = } `; -export const DELETE_GATE_MUTATION = +export const DELETE_GATE_MUTATION_OPERATION = /* GraphQL */ ` mutation DeleteGate($id: String!) { @@ -250,10 +277,28 @@ export const DELETE_GATE_MUTATION = } `; -export const REORDER_GATES_MUTATION = +export const REORDER_GATES_MUTATION_OPERATION = /* GraphQL */ ` mutation ReorderGates($programId: String!, $orderedGateIds: [String!]!) { reorderGates(programId: $programId, orderedGateIds: $orderedGateIds) } `; + +export const SUBMIT_GUESS_MUTATION = SubmitGuessDocument; +export const REQUEST_CLUE_MUTATION = RequestClueDocument; +export const RESET_SESSION_MUTATION = ResetSessionDocument; +export const GET_PROGRAMS_QUERY = GetProgramsDocument; +export const GET_PROGRAM_PROGRESSION_QUERY = GetProgramProgressionDocument; +export const GET_IN_PROGRESS_PROGRAM_QUERY = GetInProgressProgramDocument; +export const PROGRAM_QUERY = ProgramDocument; +export const PROGRAM_GATES_QUERY = ProgramGatesDocument; +export const MY_PROGRAMS_QUERY = MyProgramsDocument; +export const ME_QUERY = MeDocument; +export const CREATE_PROGRAM_MUTATION = CreateProgramDocument; +export const UPDATE_PROGRAM_MUTATION = UpdateProgramDocument; +export const DELETE_PROGRAM_MUTATION = DeleteProgramDocument; +export const CREATE_GATE_MUTATION = CreateGateDocument; +export const UPDATE_GATE_MUTATION = UpdateGateDocument; +export const DELETE_GATE_MUTATION = DeleteGateDocument; +export const REORDER_GATES_MUTATION = ReorderGatesDocument; diff --git a/src/worker/graphql/gameplay/sessionIdentity.integration.spec.ts b/src/worker/graphql/gameplay/sessionIdentity.integration.spec.ts index 57f2639c..20b6b5fc 100644 --- a/src/worker/graphql/gameplay/sessionIdentity.integration.spec.ts +++ b/src/worker/graphql/gameplay/sessionIdentity.integration.spec.ts @@ -14,6 +14,7 @@ import { invalidateCachedSchema } from "@worker-routes/graphql"; import { gqlRequest } from "@worker-test-utils/gqlRequest"; import { setupTestDb } from "@worker-test-utils/setupDb"; import { drizzle } from "drizzle-orm/d1"; +import { print } from "graphql"; import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; vi.mock("@worker-graphql/gameplay/analytics", () => ({ @@ -102,7 +103,7 @@ describe("server-issued session identity", () => { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ - query: GET_PROGRAM_PROGRESSION_QUERY, + query: print(GET_PROGRAM_PROGRESSION_QUERY), variables: { programId: E2E_PROGRAM_ID }, }), }); @@ -124,7 +125,7 @@ describe("server-issued session identity", () => { Cookie: `${SESSION_COOKIE_NAME}=${sessionId}`, }, body: JSON.stringify({ - query: SUBMIT_GUESS_MUTATION, + query: print(SUBMIT_GUESS_MUTATION), variables: { programId: E2E_PROGRAM_ID, gateId: E2E_GATE_1_ID, @@ -179,7 +180,7 @@ describe("server-issued session identity", () => { }); it("rejects a multi-operation document without an operationName", async () => { - const multiOp = `${GET_IN_PROGRESS_PROGRAM_QUERY}\n${RESET_SESSION_MUTATION}`; + const multiOp = `${print(GET_IN_PROGRESS_PROGRAM_QUERY)}\n${print(RESET_SESSION_MUTATION)}`; const response = await rawRequest("/api/graphql", { method: "POST", @@ -195,7 +196,7 @@ describe("server-issued session identity", () => { }); it("rejects a multi-operation document even with a header", async () => { - const multiOp = `${GET_IN_PROGRESS_PROGRAM_QUERY}\n${RESET_SESSION_MUTATION}`; + const multiOp = `${print(GET_IN_PROGRESS_PROGRAM_QUERY)}\n${print(RESET_SESSION_MUTATION)}`; const response = await rawRequest("/api/graphql", { method: "POST", @@ -214,7 +215,7 @@ describe("server-issued session identity", () => { }); it("rejects a mutation over GET", async () => { - const mutation = RESET_SESSION_MUTATION.replace(/\s+/g, " "); + const mutation = print(RESET_SESSION_MUTATION).replace(/\s+/g, " "); const response = await rawRequest( `/api/graphql?query=${encodeURIComponent(mutation)}`, { diff --git a/src/worker/test-utils/gqlRequest.ts b/src/worker/test-utils/gqlRequest.ts index b8480a46..ee0368ff 100644 --- a/src/worker/test-utils/gqlRequest.ts +++ b/src/worker/test-utils/gqlRequest.ts @@ -4,6 +4,8 @@ import { TRIPWIRE_HEADER, TRIPWIRE_HEADER_VALUE, } from "@worker-test-utils/testConstants"; +import type { DocumentNode } from "graphql"; +import { print } from "graphql"; export interface GqlRequestOptions { sessionId?: string; @@ -37,7 +39,7 @@ export interface GqlResponse { * the CSRF guard. */ export async function gqlRequest( - query: string, + query: string | DocumentNode, opts: GqlRequestOptions = {}, ): Promise { const headers: Record = { @@ -57,12 +59,14 @@ export async function gqlRequest( headers["x-auth-test-user-secret"] = opts.testSecret; } + const queryText = typeof query === "string" ? query : print(query); + const response = await exports.default.fetch( new Request("http://localhost/api/graphql", { method: "POST", headers, body: JSON.stringify({ - query, + query: queryText, variables: opts.variables ?? {}, }), }), diff --git a/tsconfig.e2e.json b/tsconfig.e2e.json index d2c77bcd..b0610cbf 100644 --- a/tsconfig.e2e.json +++ b/tsconfig.e2e.json @@ -8,6 +8,7 @@ "include": [ "e2e", "src/shared/gqlQueries.ts", + "src/shared/generated/graphql.ts", "src/worker/test-utils/testConstants.ts" ] }